emeticman — 2013-06-18T07:48:49-04:00 — #1
Apologies if this topic has already been answered, but a quick search yielded no solution.
Ref: Novice to Ninja
File: chapter9/includes/access.inc.php (pg.302)
Can someone please explain to me where the value for the argument ($role) comes from in this function.
I thought values needed to be passed into functions via arguments included in the function call.
I can't see where $role has been declared or even a value for it.
Thanks in advance
cpradio — 2013-06-18T08:04:31-04:00 — #2
If you scroll down to page 305, you will find this:
if (!userHasRole('Account Administrator'))
$error = 'Only Account Administrators may access this page.';
There you can clearly see, it will be passed a value. In this particular use, the $role used in userHasRole will contain 'Account Administrator'
emeticman — 2013-06-18T08:28:25-04:00 — #3
Thank You cpradio. Much appreciated. I was only looking in the access.php file.
Enjoy your day.