Member
Member
Michel Gagnon   2012-02-24, 20:01
#1

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.

Administrator
Member
Member
sbillard   2012-02-24, 23:52
#3

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.

  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.