common canUser - jcobban/Genealogy GitHub Wiki
function canUser($action)
The function canUser takes the desired capability to perform as a string parameter and returns true if the current user can perform that function. This searches the string value of the field auth for the currently signed on user for a match on the requested token. This always returns true for an administrator, that is a user who has $user‑>get('auth') == 'yes'. It returns false for casual visitors.
The following are some of the supported values for the parameter $action.
| action | interpretation |
|---|---|
| 'all' | User is an administrator who can perform any action on the system. |
| 'edit' | User has the authority to update some resources, in particular that portion of the Family Tree that the user is related to. |
| 'pending' | User has not verified their e-mail address. |
| 'blog' | User is authorized to post blogs on the site. |
| 'admin' | User can perform some administrative functions. |
Next: dialogBot