Menu Content

Support

> Forums, FAQs & Paid Support
Welcome, Guest
Username Password: Remember me

Acces for single user, not group
(1 viewing) (1) Guest
Support forum for users using free edition of JoomDOC. These forums are mainly for mutual help between users.

NOTE: Due to our capacity limitations, ARTIO does not monitor this forum category regularly. If you want direct support from ARTIO, please start a ticket at Support Dashboard. If you have no support ticket available, you need to purchase it.
  • Page:
  • 1

TOPIC: Acces for single user, not group

Acces for single user, not group 5 years, 11 months ago #44839

Hello.
My friend is using your component, he told me that it's very good tool and it helps lot in his work- so I've decided to try it.

Few days ago I've started to install it, make some changes on frontend and it'sgreat.
But now I see that this tool is not for me with this features :/ I must have a component where I will decide which file is for which user, not group.
I've made one new feature- which group can download file (if, you aren't in this group- sorry, you can't download) and now I need some help, because I don't know how to change the code...
User 1 can look on file asd.txt, user 2 can see document qwe.txt, and user 3 can see both and he can also download it and so on.

I think it's not big change in the code, but I don't know how it should be...
Thanks a lot for answer

And this is my trick for download only for one group (with ID 9)

file.php
        echo '<div class="toolbar">';
if ($this->access->canDownload) {
if ($this->access->licenseID) {
echo '<a class="modal download" rel="{handler: \'iframe\', size: {x: ' . JOOMDOC_LIGHTBOX_WIDTH . ', y: ' . JOOMDOC_LIGHTBOX_HEIGHT . '}, onClose: function() {}}" href="' . JRoute::_(JoomDOCRoute::viewLicense($this->access->licenseID, $this->access->licenseAlias, $this->access->relativePath, $this->access->alias)) . '">' . JText::_('JOOMDOC_DOWNLOAD_FILE') . '</a>';
} else {
if ($groups[9] == 9){
echo '<a class="download" href="' . JRoute::_(JoomDOCRoute::download($access->relativePath, $access->alias)) . '" title="">' . JText::_('JOOMDOC_DOWNLOAD_FILE') . '</a>';
}else{
echo "Sorry -can't download";
}
}
}


default.php
            if ($access->licenseID) {
echo '<a class="modal download" rel="{handler: \'iframe\', size: {x: ' . JOOMDOC_LIGHTBOX_WIDTH . ', y: ' . JOOMDOC_LIGHTBOX_HEIGHT . '}, onClose: function() {}}" href="' . JoomDOCRoute::viewLicense($access->licenseID, $access->licenseAlias, $access->relativePath, $access->alias) . '">' . JText::_('JOOMDOC_DOWNLOAD_FILE') . '</a>';
} else {
$user = JFactory::getUser();
$groups = $user->get('groups');
 
if ($groups[9] == 9){
echo '<a class="download" href="' . JRoute::_(JoomDOCRoute::download($access->relativePath, $access->alias)) . '" title="">' . JText::_('JOOMDOC_DOWNLOAD_FILE') . '</a>';
}else{
echo "Sorry -can't download";
}
if ($access->canOpenFile || $access->canOpenFolder) {
// link to open file/subfolder
echo '<a href="' . $viewDocuments . '" class="readmore" title="">';
}
// as item title use document title or file name. use title only if published. (that means that owner will see it even if unpublished)
echo JText::_('JOOMDOC_DISPLAY_FILE');
if ($access->canOpenFile || $access->canOpenFolder) {
echo '</a>';
}
}
Last Edit: 5 years, 11 months ago by kikutnik666.
The topic has been locked.

Re: Acces for single user, not group 5 years, 11 months ago #44862

  • jitr
  • OFFLINE
  • ARTIO Support
  • Posts: 1432
Hello, JoomDOC uses standard permissions of Joomla which controls whole usergroups but not single users. If you need to improve it you should start improving in the file administrator/components/com_joomdoc/libraries/joomdoc/access. These classes manage permissions in whole component.

But this forum is for users only. Not for programmers. We cannot give you more advices how to customise the component. If you have a problems to customise the component in your own we can offer you a paid customisation.
ARTIO Support Team
The topic has been locked.
  • Page:
  • 1
User Login Empty