[Solved]How to disable 'view permission' and 'reorder' from sidebar and dropdown menu?

yeahy

Joined: 2008-11-07
Posts: 69
Posted: Fri, 2008-12-26 10:51

After search & test for many solutions within the forum, I has successfully disabled the 'edit permission' from sidebar and dropdown menu for user album.

Now the question is how to disable 'view permission' and 'reorder' from sidebar and dropdown menu?

As to 'view permission', after the user album owner's 'edit permission' was revoked, he still has the 'view permission'. So how to remove the 'view permission' also?

As to re-order, I have setup re-arrange plugin, so re-order is a dulplicate function.

Update: Solved. See below. Not perfect but works.

 
yeahy

Joined: 2008-11-07
Posts: 69
Posted: Fri, 2008-12-26 11:00

is it related with modules/core/module.inc,

Quote:
if (isset($permissions['core.edit'])) {
if ($isAlbum && $childCount > 1) {
$views[] = array('name' => $this->_translate('Reorder Items'),
'view' => 'core.ItemReorder');
}

and

Quote:
$views[] = array('name' => isset($permissions['core.changePermissions'])
? $this->_translate('Edit Permissions')
: $this->_translate('View Permissions'),
'view' => 'core.ItemPermissions');
}

 
yeahy

Joined: 2008-11-07
Posts: 69
Posted: Fri, 2008-12-26 12:15

work around Solution:

for reoder (two similar blocks):
find

Quote:
if ($isAlbum && $childCount > 1) {

replace

Quote:

if ($isAlbum && $childCount < -999) {

for view permission(two similar blocks):

Quote:
$views[] = array('name' => isset($permissions['core.changePermissions'])
? $this->_translate('Edit Permissions')
: $this->_translate('View Permissions'),
'view' => 'core.ItemPermissions');
}

add before

Quote:
list ($ret, $isSitedmin) = GalleryCoreApi::isUserInSiteAdminGroup();

if ($ret) {
return $ret;
}

if ($isSitedmin) {

, after the end, add a close "}".