Question

I need your help, knowledge and support :) I know, this is a lot...

While writing the procedure for authentification I've found a code snippet as the following:

$role = Zend_Auth::getInstance()->hasIdentity() ? 'member' : 'guest';

The hasIdentity() part is clear, but what does ? 'member' : 'guest'; mean?

I think these are my roles and it is about heredity between the roles, isn't it?

An the next questions is, how do I extend this code if I have more roles in my Zend_Acl than only "guest" and "member", for an example "guest", "member-std", "member-prm", "...", "admin"?

Thousand thanks in advance and a happy day!

Was it helpful?

Solution

This is just simple classification of users to enable/disable certain functions like comment, rating etc.

for extending your user to more roles you can either create one type field in your user table or create roles table and link with your user table.

Then you can set role of user in session while user logs in

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top