Hi all.
I have tried to figure out how to change the UserAlbumHelper.class to get the default permissions for my user albums correct. Now I am getting this error.
Warning: Cannot modify header information - headers already sent by (output started at /home/superfel/public_html/photos/modules/useralbum/classes/UserAlbumHelper.class:161)
The file has the following now:
/* Set permissions.. */
$ret = GalleryCoreApi::removeItemPermissions($albumId);
if ($ret) {
GalleryCoreApi::releaseLocks($lockId);
return $ret->wrap(__FILE__, __LINE__);
}
$ret = GalleryCoreApi::addGroupPermission($albumId,$core['id.adminGroup'], 'core.all');
if ($ret) {
GalleryCoreApi::releaseLocks($lockId);
return $ret->wrap(__FILE__, __LINE__);
}
$ret = GalleryCoreApi::addGroupPermission($albumId,$core['id.everybodyGroup'], 'comment.view');
if ($ret) {
GalleryCoreApi::releaseLocks($lockId);
return $ret;
}
$ret = GalleryCoreApi::addGroupPermission($albumId, $core['id.everybodyGroup'], 'rating.all');
if ($ret) {
GalleryCoreApi::releaseLocks($lockId);
return $ret;
}
$ret = GalleryCoreApi::addGroupPermission($albumId, $core['id.allUserGroup'], 'cart.add');
if ($ret) {
GalleryCoreApi::releaseLocks($lockId);
return $ret;
}
$ret = GalleryCoreApi::addGroupPermission($albumId, $core['id.allUserGroup'], 'comment.add');
if ($ret) {
GalleryCoreApi::releaseLocks($lockId);
Anyways... I would like my registered users to have their own album with the following permissions
Owner - add sub-album, delete sub-album
Everyone - rate, add & view comments, view items
Can someone please tell me how to modify the UserAlbumHelper.class?
Cheers
Nic
Posts: 8601
remove any spaces or blank lines you added at the line referenced above in UserAlbumHelper.class
Posts: 38
Thanks, got it working reasonably now...
Can someone please post the correct lines of
" $ret = GalleryCoreApi::addGroupPermission($albumId,$core['id.adminGroup'], 'core.all');"
I need to achieve the above permissions.
The sub-album creation and deletion are the most important.
Cheers
Nic
Posts: 8601
use GalleryCoreApi::addUserPermission($albumId, $user->getId(), 'the.permission'); to grant something to the owner.
note that the code you're working on has changed in current svn/gallery2.2. new user albums now inherit permissions from the parent album (so they can get things like comment/rating permissions) and only adjust the view permissions according to the site admin settings.
Posts: 38
Great!
Cheers
Nic
Posts: 3
I'm currently using the current version but find that child albums are not inheriting permissions. Is there some setting I should adjust to allow this default where they will?
I have one main album as a default where Everybody can view all items and all comments. Registered Users can add commends.
When a user registers, a new album is created for them, but although that album is in the parent album with permissions set as listed above, the permissions of any album newly created when someone registers have permissions of everybody views items only, no registered users permissions re set and no views of comments are set for anyone.
What am I missing?
TIA
Posts: 8601
User Albums module is an exception.. in G2.1.x new user albums did not inherit the parent albums permissions. This is fixed in current svn/nightly snapshot/upcoming G2.2.. now it will inherit all permissions except for view permissions, which are specified in Site Admin / User Albums.
Posts: 17
hi guys
i am using rating module with gallery2,
when we enable rating in edit album, the rating/vote enables for all items of the album. i want to not enable rating/vote for all items, enable only for few/selected items. can anyone guide me.
deepsingh