Not sure if this belongs in this topic area, but since I would consider it a "customization" that is why I picked it... Moderators, feel free to move to another area if appropriate.
The User Albums plugin seems to fill the need for so many people....almost! Almost without exception I would think that anyone activating this module *probably* has an issue with the default permissions assigned. Yes, you can get fairly close by setting the perms in the parent album but *many* admins (it would appear) don't want users to be able to delete the album, move it, DEFINITELY not set perms and often times don't want the ability for the user to "edit" the album. Those abilities just open up such a large can of worms!!! Not to mention that the average user probably will not know what to do once they get into those areas.
I've seen *many* questions posed about changing these perms... from what I understand it is done in the UserAlbumHelper.class file. I have looked at this file and even though I can *usually* muddle through altering PHP code....this one is VERY intimidating.
I understand that the goal for a support forum is to get the user to learn for himself...the old "Teach a man to fish" bit, but it would seem that this particular topic seems to hit so many people and questions keep rolling in.
Please...Would it be possible once and for all to provide a "cookbook" type of approach for an answer to this? I can't help but feel that it would EXTREMELY benefit the forum as a whole to have a definitive posting.
All of the below assume that the User Albums module is installed and the site admin wants to remove a few of those defaults:
Suggestion: How to remove the "edit album", "Edit Permissions", "Move Album"... etc.
9 times out of 10 the site admin wants to "lock" a user into their personal album and just let him/her upload and delete their pictures. *Maybe" create sub-albums...maybe not.
How 'bout it? Anybody up to the challenge of providing the "ultimate answer" here?
Posts: 19
Anybody?
I've given this a bit more thought since the original posting... This could be accomplished by some "re-tooling" of the UserAlbumHelper.class file. If someone knowledgeable could propose a new file that had some variables defined near the beginning that allowed for a manual edit of each perm by setting it "True" or "False"; "1" or "0"...whatever. This way, users could easily pick and choose their desired perms.
Is this feasible? Would it not be worthwhile to enhance the usabilty?
Posts: 19
Nobody? Perhaps this is not as big an issue as I suspected, although judging by the number of requests for help in this area it's not a trivial matter to many.
At a minimum, it would really be nice if someone that *has* modified the UserAlbumHelper.class file to post their altered file and explain what their mod does...perhaps we can use that as a guide.
Posts: 8
Wow this post is excellent and I can't believe no one has responded to this. That is very unfortunate. I can't agree more with RCurtis that something needs to be said or done about the lack of user permissions in Gallery 2. There definately needs to be Add Photo and Delete photo permissions without having to give the user rights to move album, edit system paths, etc. Is there a mod for this? Without this ability Gallery 2 is unfortunately not an album solution for those who have a large user groups that contribute to the Albums.
http://www.iowadeer.com
Posts: 19
***THANK YOU ***
I was beginning to think that maybe I was out in left field as far as the request!
Surely *somebody* has addressed this issue and will share their work with the rest of us....
Posts: 70
RCurtis,
it might take some hours to search the forum for the right threads, but there are already a few solutions to limit the user permissions.
One of them is to install the module "jenspermissions".
http://gallery.menalto.com/node/26165
I did it plus I changed the redirection link as described by "kordobes" in this thread:
http://gallery.menalto.com/node/54371
So now the only permissions users of my gallery have are
-adding albums/items
-deleting their own albums/items (optional, can be removed if I like to)
All options like editing albums, setting up user permissions, thumbnail size and so on are removed like it is if you use the "simple module".
Posts: 27300
Can somebody that has used "jenspermissions" please create a codex page to show how it works. If you need help with that let me know and I can create the page but need somebody that has used it to 'flesh it out a bit'.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 70
I can test the module on a fresh gallery 2.2.4 installation and see if I can find out how to add and remove specific permissions. If I get some useful results from this, I´ll let you know.
Posts: 19
I promise you...I *have* spent several hours in the forums. I guarantee I have read every single post involving user permissions. I *did* find this refernce to the "jenspermissions" module. Quite frankly, I could never find what appeared to be a final version...there are several postings where a different version is listed. I guess you could always say "well the obvious correct one is the last one...".
I was never able to find an official "download" for this module, so I was very nervous about activating code that had such sparse documentation and only "lived" in a forom posting. If this module truly performs, why is it not available as a "real" downloadable module?
Posts: 8
Once again another great post from RCurtis. First of all why are these permissions not a part of the base install. This seems to be a serious lack of oversight with the 2.x version. It appears that the upload photo and delete photo type permissions were a part of 1.1 based on other information I have read on here. Why would such essential permissions be removed in the latest version? If you read the jensperms post I am not the only one scratching my head at the lack of these permissions in the base install. Back to RCurtis' last post. The lack of a recognized official version plus the fact there is no codex page for this mod makes it a troubling mod to install. Also - how do you install such a mod where there is just raw source code pasted into a forum post? Although there is docmentation (http://codex.gallery2.org/Gallery2:Installing_Additional_Components) on installing user contributed plugins for which there is a codex page there is nothing I can find on installing a mod such as this. Thanks
http://www.iowadeer.com
Posts: 27300
somebody has to maintain it and add it to the gallery-contrib SVN repository. Once that is done then it would be available via downloadable plugins.
So the short answer is somebody needs to do it. Anybody volunteering?
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 19
I suggest that a mod of this nature be rolled into the regular UserAlbum Module. That would seem to be the obvious place for it. How would one go about setting something like that in place? I assume that there is a degree of "ownership" from whomever actually wrote the UserAlbum module, unless it was done by the core dev team. (My apologies, I don't have a good feel yet for the "structure" or "control" group behind Gallery.)
Posts: 70
I was not able to get jensperms module working in my gallery 2.2.4, but I found a pretty easy way to limit permissions on "normal" albums (not albums created by user album module!). I guess that´s not what RCurtis is looking for, but maybe someone else is interested in this "solution":
1. Create an album called for example "userphotos" with following permissions:
- Everyone [core] View all versions
- Registered User [core] Add sub-album
- Registered User [core] Add sub-item
This is the album where users should be allowed to upload their pictures and/or create their own albums.
2. Replace the file gallery2/modules/core/ItemAddAlbum.inc with the attached one
So now registered can only create albums and upload items. All permissions to edit, move and delete albums/items, choose themes and set permissions to their created albums are removed.
Posts: 19
I was not able to get the jensperms module to do anything either...of course with no documentation and no admin interface "how would you know if it *was* working?" <grin> Just kidding!
I've done quite a bit of thrashing through code and forum postings, and have come to realize that jensperms is NOT needed for what I originally asked. I'm about 90% to an answer with only modifying the UserAlbumHelper.class file. I have to admit, I was getting rather frustrated with what I perceived as a lack of support here in the forum. I've worked with quite a few open source packages to date, but this is the first one where users are *almost* told "Go look it up yourself..."
Now, I'm quite certain that doing forum level (and volunteer!) support probably does get quite old...and you see the same questions over and over, I'm sure. There's *always* going to be the guy that says "I just want my answer and I don't have time to search through a forum!" I would lose my patience very quickly with this person, too. But... when you see *so many* people asking about the same topic...and a topic so closely related to a *standard* plugin module, you begin to wonder if maybe we've lost sight of the forest for the trees! Either one of two things happened:
1) They gave up becuase they could not find the info buried within the maze, or
2) They actually *did* find a solution on their own but didn't bother to come back and share it with everybody else...after all, "I had to do all the work myself...I don't owe those people anything!"
Obviously, that's not the spirit we want to foster in people...but *something's* wrong here where so many people have asked and there's no real definitive posting.
I *will* be posting a revised version of UserAlbumHelper.class with documented sections to uncomment to accomplish various permission sets. Perhaps the powers that be will see fit to incorporate this simplified file into the UserAlbum module. There's only a couple of items I still want to achieve...maybe after I post someone will be kind enough to fill in the pieces I am missing. Stay tuned!
Posts: 19
As promised: Here is a revised UserAlbumHelper.class file that should go a long way towards helping people understand how to set user perms in the UserAlbums module. This file lives in "modules/useralbum/classes" folder.
The code as listed will function EXACTLY as the original file...you have to actively un-comment sections to make a change from the default.
I have discovered some quirks along the way while on this journey. In Section 5, (core.edit)... For some strange reason the developers have seen fit to allow the user to View Permissions. This particular item does not seem to fit in with the "edit" theme that it deals with... Perhaps someone can explain the logic behind this...or maybe it's a mistake?
Also, Section 3, (core.delete)... this perm throws in the "move" category. This too, does not fit, at least in regards to the UserAlbums module. I realize that the perms were probably designed long before the UserAlbums module...but still it would seem to be more prudent to split "move" out as its own perm.
What's next along this same line? Well, the obvious piece that is missing is for someone to write a small admin screen that let's you set these things via the plugin. This is beyond my means at this time. Hopefully someone will pick up the ball and run with it. I hope this thread helps those looking for the answers to setting UserAlbum perms!
Posts: 19
Anybody have a clue how you would implement access to this type of function via an admin screen under SiteAdmin?
Posts: 13
thanks so much
Posts: 314
if someone needs it, I have a functional jensperms for G2.2.4 - no admin interface!
serbanc - www.e-poze.ro
Posts: 24
Thank you very much for your efforts this piece of code RCurtis. Although it still doesn't allow what I was looking for (http://gallery.menalto.com/node/80318#comment-282451 ) due to limited capabilities of the gallery itsself, it's nice to see someone actually "did it" and provided a useful solution, which is directly usable. (I Hope it still works in g2.2.x onwards)
btw: when reading through the forums I have to admit I share the thoughts you wrote down here in most parts...
@serbanc: if I hadn't known the /downloads on your page, I wouldn't have found your files just with that link posted here ;-)
(your GUI doesn't seem to lead there)
Posts: 20
Nice thread! I was trying to do the very same thing in this other thread. I had minor success after hacking the ownerperms module (not User Albums), but no fully working solution (I still have to create each top-level user album by hand to set primary permissions). Other tweaks involved hiding overly-complicated functions from the interface for the sake of simplicity (but not actually fixing permissions against showing them).
Alas, it has been some time, now my Gallery is out of date, and I have sparse notes on what I did.
Many thanks to RCurtis for taking the reins on this major issue. My previous post is a perfect example of the community (and its leaders) being rather negative:
While I'm ranting, I'm convinced Gallery's code base is about 90% too complicated for the function of showing pictures on the Web. I'm no Web developer, so I can't do better, and Gallery is OK for hacking around with.
UPDATE: I've updated my other post to vaguely document how I create user albums with the proper permissions.
Posts: 118
Anyone have updated version that works with gallery 2.3? File rev. version 18064
Posts: 118
bump
Posts: 24
With a few lines added, this works with 2.3. I am still testing, but seems to work fine.
To bad this only works when creating new albums, it would be nice if you could make changes to all user albums with a single admin page.
Thanks to everyone and especially RCurtis for this code, this saved me a lot of work.
Posts: 27300
How did you make out? does the new version for G2.3 still fit the bill?
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team