I've been having trouble with XN_Profile::grantRole. Basically I want to assign a user a role and retrieve that when i need it.
This is my code:
$profile = XN_Profile::current();
XN_Profile::grantRole($profile->screenName, 'myRoleHere');
This returns and error in the error log saying:
#0 /php/includes/XN/XN/Profile.php(573): XN_Exception::reformat('Failed grant ro...', Object(XN_Exception))
Does the role I'm granting have to be already made? If so where do I create a role? Doesn't seem to have a function in the documentation to create roles.
Tags: grant, role, roles, xn_profile::grantrole
Share