Remove "edit permissions" when user add subAlbum
nanodreams
Joined: 2007-10-29
Posts: 3 |
Posted: Mon, 2007-10-29 19:01 |
Hello I would like to remove the "edit permissions" options when a user add a new Album. Anybody know how make it, Thanks, |
|
Posts: 16
I am in the same boat. I REALLY wish users had no such ability to edit their albums as it seems to be confusing to "Average Joe". I'd much rather prefer that newly created albums by users would inherit permissions and settings of "Parent" album. Kind of "Dumb Out" regular default user and save them from themselves.
Can anyone shine some light on this for us? Pls?
Thanks
Eugene
Posts: 16
c'mon guys! Please!!!! Someone HAS to know!!! Plz? Pretty please?
Posts: 32509
please google the question, it has been discussed before.
i guess you'll need the "jens permissions" module or your own module to dynamically set permissions of new albums as they are created.
--------------
Documentation: Support / Troubleshooting | Installation, Upgrade, Configuration and Usage
Posts: 3
Hello finally I find the code to make it.
Open and edit <install dir>/modules/core/ItemAddAlbum.inc
Find
$ret = GalleryCoreApi::addUserPermission($instance->getId(),
$instance->getOwnerId($
'core.all', false);
Append after
$ret = GalleryCoreApi::removeUserPermission($instance->getId(),
$instance->getOwnerId(),
'core.changePermissions',false);
This code remove de "Edit Permissions" only in the album, but if you view a photo y can change the permissions, to remove this option,
Open and edit <install dir>/modules/core/ItemAdd.inc
Find
$ret = GalleryCoreApi::addUserPermission($album->getId(), $album->getOwnerId(),
'core.all', false);
Append after
$ret = GalleryCoreApi::removeUserPermission($instance->getId(),
$instance->getOwnerId(),
'core.changePermissions',false);
It's all.
Posts: 16
DUDE!!!! U AWESOME! This IS DA SHIZLE!!! I am just really excited that it worked out. Works great!
Thanks so very much!
Now, think you can figure out how to lock them out of Album Edit/Picture Edit once new album/picture had been created?
THAT would make my life perfect LOL
Eugene
Posts: 3
Hello 25PSi
If you want to remove other options of de sideBar y only add another line like the example modify de options. For example if you want to remove de posibility that the user can remove his own photos, you must add this code.
$ret = GalleryCoreApi::removeUserPermission($instance->getId(),
$instance->getOwnerId(),
'core.delete',false);
If you want to remove the option "Edit", you must add this code
$ret = GalleryCoreApi::removeUserPermission($instance->getId(),
$instance->getOwnerId(),
'core.edit',false);
Posts: 1
Hello nanodreams,
I would like to remove the 'Edit Album' feature in the 'Side Bar' so that the Album User is restricted from editing his Album. Can you tell me what file I need to add your line of code to? You noted the required line of code in your earlier posts (discussions) with 25PSi? Please see below, i.e.,
$ret = GalleryCoreApi::removeUserPermission($instance->getId(),
$instance->getOwnerId(),
'core.edit',false);
I was successful editing the ItemAdd.inc , and the ItemAddAlbum.inc files concerning the 'Edit Permissions' and the 'change permissions' modifications.
Your code modifications worked perfectly!!
Thanks so much for your assistance.
Steve
Posts: 14
Hello nanodreams,
everything fine with the ItemAdd.inc , and the ItemAddAlbum.inc, but I noticed something: I loged into my site as an usual user and created an Album with Items inside it before and after pasting your code.
What's happen is this: after your code is in, the "edit permission" is not anymore visible, and it is OK
but in the album I created first your code in, the "edit permission" is still there.
Is it normal? How come it affects only the new albums and items and not the old ones?
Posts: 1
Thanks
Posts: 7
that works fine
Thanks a lot
Can i do that also with the move album and move photo permission?
Posts: 15
GDay All,
I added the following to ItemAddAlbum.inc and whenever a user adds an album instead of going to the Edit Album page, he/she gets a security violation message.
The album is created and one can add files etc, but there is no option to edit the album either in the dropdown box or the sidebar which is exactly what I wanted.
I would simply like to skip the security violation message. Anyone know how I could do that?
Added Code (ItemAddAlbum.inc):
$ret = GalleryCoreApi::removeUserPermission($instance->getId(),
$instance->getOwnerId(),
'core.edit',false);
TIA
Regards
trumpy81
Posts: 25
<install dir>/modules/core/ItemAdd.inc
<install dir>/modules/core/ItemAddAlbum.inc
Hi,in G2 2.3,i can't find the code in the two files.
and
where can find it?
Posts: 2
I've been banging my head against this for the last 4-5 hours, but I've got a working solution for Gallery 2.3.
In file %installdir%/modules/core/ItemAddAlbum.inc:
Look for:
And add this under it:
Once you've done this, you'll need to change the code directly below it:
Replace it with this:
Good luck everyone!
Posts: 118
Hi, just tried this on gallery-2.3-typical-en.
My file ItemAddAlbum.inc has different lines in it:
/* Figure out where to redirect upon success */
$redirect['itemId'] = $instance->getId();
$ret = GalleryCoreApi::assertHasItemPermission($instance->getId(), 'core.edit');
if (empty($ret)) {
$redirect['view'] = 'core.ItemAdmin';
$redirect['subView'] = 'core.ItemEdit';
$redirect['editPlugin'] = 'ItemEditAlbum';
}
Trie to make it like above but "edit permissions" link is still there in album, in photos on left side bar.
HELP.
Posts: 2
You have the lines there.
First edit
Second edit:
Keep in mind, this will only apply permissions to items created after you've made the mod- you have to manually set permissions on all other items and galleries.
Posts: 118
How do I make the selection:
"Add photo to Cart"
To appear under albums too? I would like that it would be possible to add entire album to cart.
I have checked the "Treat Albums as collections of contained images?" checkbox
And I think this is because I use this modification that users can't see another user galleries.
I use edited ItemAddAlbum.inc from Core module and UserAlbumHelper.class from useralbum module
I use Checkout module 0.4.3
Checkout by Email 0.4.0
see my thread here http://gallery.menalto.com/node/91975
Posts: 1
Bit of an old one, but I couldn't find a clear answer to this anywhere. I was looking for a way to remove the 'edit permissions' section for all new members using the user albums plugin. bharat on the IRC channel was gracious enough to help. So here's the simple fix for 2.3.1:
Edit /modules/useralbum/classes/UserAlbumHelper.class
Find:
Add just under it: