Working with users/Creating Users external
If you can create a user with the following:
$profile->setLogin('bit-bucket@x-cart.com'); $profile->setPassword(\XLite\Core\Auth::encryptPassword('te ster')); Is there a way to set the user access level to Admin instead of Customer? Any help is appreciated. Thanx |
Re: Working with users/Creating Users external
Maybe try
Code:
$profile->setAccessLevel(100); |
Re: Working with users/Creating Users external
totaltec.. I tried that and it does set them as administrator but the Administrator role still has be be added to "roles".
In other words.. It sets the "Access Level" to administrator under the user tab but it will not add the Administrator the "Roles". |
Re: Working with users/Creating Users external
totaltec, Thanks for the advice.
I tried that and it does set the Access level to Administrator but to full work it also needs to set the "Roles" as Administrator. Or, add the Administrator to the Roles. |
Re: Working with users/Creating Users external
Quote:
Looks a little tougher to figure this part out. Something like $profile->addPermissions($permissions), but I am not sure what the value of $permissions should be! Or if that method is even accessible to that object. I'm shooting in the dark here, glad the first bit worked. Perhaps Tony or someone else with knowledge can shed some light. I could certainly work this out for you, but I can't do it off the top of my head without research. |
Re: Working with users/Creating Users external
I think I got it. You have to add the role after the user is created.
$profile->addRoles($role); $profile->create(); $role->addProfiles($profile); |
All times are GMT -8. The time now is 05:55 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.