Support Forums | Demo Gallery [1.x] [2.x] | Downloads | News | Site Map ]
Nuked Gallery
  Create a FREE account or Login   As a guest, you don't have access to our FULL navigation system.
 Forum FAQForum FAQ   StatisticsStatistics   SearchSearch   UsergroupsUsergroups   FavoritesFavorites  

User album default permissions

 
Post new topic   Reply to topic    NukedGallery.net Forum Index » phpBB Integration » phpBB3 / Gallery 2 Integration View previous topicPrinter friendly versionView next topic
Author Message
WizardOfZo
Supporting Member
Guru
Guru


Joined: Sep 24, 2008
Posts: 55

PostPosted: Tue Dec 23, 2008 6:38 pm    Post subject: User album default permissions Reply with quote

I have seen other posts about problems with the default permissions when a new user album is created.
None of the answers in those posts seem to answer the question:
How do I simply change the user album default permissions/

I do not want users to be able to change permissions on their albums.
I have a sub album under the top level.
No permissions are set for "Registered users" in the Gallery that is listed in User Albums as shown here:

Quote: › Group Permissions
Group name Permission Action
Everybody [core] View all versions
Site Admins All access

User Permissions
User name Permission Action
New User Permission



Every time I create a test user, they have the ability to "Change Item Permissions"
and they can remove permissions to "view all versions"from "Everybody"

Is there a simple way to prevent this?
Back to top
Offline View user's profile Send private message
AdBot
   Post subject: User album default permissions  

Back to top
g2user

Novice
Novice


Joined: Dec 21, 2008
Posts: 21

PostPosted: Wed Dec 24, 2008 9:45 am    Post subject: Re: User album default permissions Reply with quote

ha, I was very frustrated last month on this. The answer is no. The logic here is who own the album, who has the power. So you want to take away the power? no way. Shocked Mad Sad
Back to top
Offline View user's profile Send private message
WizardOfZo
Supporting Member
Guru
Guru


Joined: Sep 24, 2008
Posts: 55

PostPosted: Wed Dec 24, 2008 10:53 am    Post subject: Re: User album default permissions Reply with quote

I did find one way posted on the Gallery2 site that seems to get the job done:
in modules/useralbum/classes/UserAlbumHelper.class
After;
Code: ›    $ret = GalleryCoreApi::addUserPermission($albumId, $user->getId(), 'core.all');
   if ($ret) {
       GalleryCoreApi::releaseLocks($lockId);
       return $ret;
   }

I added
Code: ›    $ret = GalleryCoreApi::removeUserPermission($albumId, $user->getId(), 'core.changePermissions');
   if ($ret) {
       GalleryCoreApi::releaseLocks($lockId);
       return $ret;
   }


I also added this to keep users from editing the album settings:
Code: ›    $ret = GalleryCoreApi::removeUserPermission($albumId, $user->getId(), 'core.edit');
   if ($ret) {
       GalleryCoreApi::releaseLocks($lockId);
       return $ret;
   }

I tred adding this to keep users from moving an album
but it created errors:
Code: ›    $ret = GalleryCoreApi::removeUserPermission($albumId, $user->getId(), 'core.move');
   if ($ret) {
       GalleryCoreApi::releaseLocks($lockId);
       return $ret;
   }
Back to top
Offline View user's profile Send private message
jettyrat

Moderator
Moderator


Joined: Nov 28, 2005
Posts: 1144

PostPosted: Wed Dec 24, 2008 11:01 am    Post subject: Re: User album default permissions Reply with quote

I don't think core.move is a valid gallery permission. You can see the valid permissions in the g2_permissionsetmap db table...
Back to top
Offline View user's profile Send private message
WizardOfZo
Supporting Member
Guru
Guru


Joined: Sep 24, 2008
Posts: 55

PostPosted: Wed Dec 24, 2008 12:42 pm    Post subject: Re: User album default permissions Reply with quote

I changed that last one to:
Code: ›    $ret = GalleryCoreApi::removeUserPermission($albumId, $user->getId(), 'core.delete');


and that did the trick
Back to top
Offline View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    NukedGallery.net Forum Index » phpBB Integration » phpBB3 / Gallery 2 Integration View previous topicPrinter friendly versionView next topic

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours

Powered by phpBB © phpBB Group



Sponsors: Dedicated ServersDomain NamesWeb HostingDomain Name RegistrationDedicated Web HostingWeb Design New YorkCompare VoIPseo packagesSEO CompanyNew York Yellow PagesFind LocationsVOIP Phone ServiceNeckermannOnline internetSEORestaurant Locator • Get great HP coupons from CouponSnapshot • Search for great dell coupons at CouponSnapshot.com.au • Graduation DressesAndroid TabletSEO IndiaBuy Phen375fuel filter

8th year online! 2003-2011
Legal • Use of this site consitutes agreement to the Acceptable Use Policy
Hosted by Implosion WorksSourceForge.net Logo • Theme by TonicMedia