ZenphotoCMS Forum
Logged-in status and User Rights - Printable Version

+- ZenphotoCMS Forum (https://forum.zenphoto.org)
+-- Forum: Support (https://forum.zenphoto.org/forum-1.html)
+--- Forum: General support (https://forum.zenphoto.org/forum-4.html)
+--- Thread: Logged-in status and User Rights (/thread-9684.html)



Logged-in status and User Rights - Michel Gagnon - 2012-02-24

Hello,

I'm aware of the zp_loggedin() function. I also know that the $_zp_loggedin variable returns a bit-calculated value dependent on the particular rights a user has. Is there a way to find the particular bit-value of $_zp_loggedin depending on one's rights? Or is there another way around?

INTENDED USE
I have a few lambda users that will need to upload photos and update descriptions. I am writing an online user manual that will describe "How to do" this and that, and I want a user to see only the relevant parts, so a user who only is allowed to upload photos will only see that part of the user manual.

P.S. Once it's finished (not soon...), I will release it to the community.

Thanks.




Logged-in status and User Rights - acrylian - 2012-02-24

Please see:
http://www.zenphoto.org/documentation/classes/Zenphoto_Administrator.html
http://www.zenphoto.org/documentation/classes/Zenphoto_Authority.html

Also look at the files itself.




Logged-in status and User Rights - sbillard - 2012-02-24

The rights values are "defined" in the lib-auth.php script. Look at Zenphoto_authority::getRights() You should, of course, use the "name" of the right, not the numeric value as the latter can change release to release.

The usual way to to check if a user has a particular right is with zp_loggedin(right). Multiple rights can be ORed to check for the one of them being set.