Allowing users to add photos without edit permission?

Mr_Papa

Joined: 2005-09-05
Posts: 3
Posted: Mon, 2005-09-05 16:23

I must be missing something here, but I have not a found a way to allow users/groups to add images or photos (sub-items) to albums (actually sub-albums) without also giving them edit permissions which, unfortunately, gives them the ability to edit the albums at will.

It seems to me that the add items option is embedded in the edit album page. Without edit permissions, the user has no way to get to the add items option. Is this true? Or am I missing something?

fyi, this is gallery2 integrated with php-nuke 7.6...

Thanks...

Mr Papa

----

Gallery URL (optional): http://158th.com/modules.php?name=gallery2
Gallery version: gallery2 RC2
Webserver (with version):
Datatabase (with version): MySQL
PHP version (eg 4.2.1):
phpinfo URL (optional):
Graphics Toolkit(s): imgmagick
Operating system:
Web browser/version: Firefox or IE
G1 version (for migration bugs):

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Mon, 2005-09-05 16:29

actually no.

you can give a user or a group [core] add subitem or [core] add sub-album without giving them also [core] edit item.

 
Mr_Papa

Joined: 2005-09-05
Posts: 3
Posted: Mon, 2005-09-05 16:47

Thanks for the reply!

Thats the way I initially had it setup. However, the user never seemes to get shown the option/link to add items. The only place I have seen this link/option is on the edit album page. How does the user add the photos/images when there is no link to do this? With the edit album permission set, the user gets a pull down menu below the album highlight. Selecting edit album takes the user to the album editting page where they can select the add items option. Or, with edit permission set, the user can click on the edit link at the bottom of the page below the image thumbnails.

However, without the edit permissions set, neither link is available and nothing for the user to do to add items.

I must be doing something wrong here or missing something...

Mr Papa

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Mon, 2005-09-05 19:53

the "add album" link shows up in my g2 in the sidebar as item action.
you're using a theme without a sidebar / without any sidebar blocks. that was your decision. but this way, you removed some options of G2.

the item actions also show up under the item thumbnails as a drop down list. but it doesn't show all item actions there. in G2, you can decide whether to show all item action links in this drop down list or only a small subset (usability). it defaults to the small set.

you can change it.
open gallery2/themes/themeName/theme.inc (replace themeName with matrix, siriux, or any other theme that you want to change)

look for

    function showAlbumPage(&$template, $item, $params, $childIds) {
	$ret = $this->loadCommonTemplateData(
	    $template, $item, $params,
	    array('owner', 'viewCount', 'childCount', 'descendentCount', 'parents',
		  'systemLinks', 'itemLinks', 'itemSummaries', 'permissions',
		  'thumbnails', 'pageNavigator', 'jumpRange'),
	     $childIds);

replace it by

    function showAlbumPage(&$template, $item, $params, $childIds) {
	$ret = $this->loadCommonTemplateData(
	    $template, $item, $params,
	    array('owner', 'viewCount', 'childCount', 'descendentCount', 'parents',
		  'systemLinks', 'itemLinks', 'itemSummaries', 'permissions',
		  'thumbnails', 'pageNavigator', 'jumpRange', 'childItemLinksDetailed'),
	     $childIds);

basically, we just added 'childItemLinksDetailed' to the list in the array().
save the file, refresh an album page, it should show up now.

 
Mr_Papa

Joined: 2005-09-05
Posts: 3
Posted: Mon, 2005-09-05 20:20

Thanks! It worked like a charm. I hadnt noticed that on the sidebar before I disabled it. Yes, I realize I lost some intended functionality in G2 with it, but being this site is in php-nuke, I felt I was short on space. I will take a look at it back in and see what else I am missing vs the tradeoffs.

Thanks for the outstanding help!

Mr Papa