I'm using cakeDC.users plugin for CakePHP 3.6.x with social login via google.
Currently the default role for a new user is "user". How can a change this?
You can specify the default role of all registered users via configuration file https://github.com/CakeDC/users/blob/master/config/users.php#L43
Override the Users.Registration.defaultRole and use the one you would like to use.
Related
hello i want to add autorization roles like admin and editor users for my reactJs dashboard using firebase .
when a user create his own account he will be a editor by default.
in the same time i want to create just one user as an admin so he can do extra things .
You can use firebase custom claims which can be used for role based control access.
Check out https://firebase.google.com/docs/auth/admin/custom-claims for more information.
I'm using the CakeDC/Users plugin and want add other user roles.
Right now I have the both superuser and user roles.
I'm doing the permissions control in the permissions.php.
I'm also overwriting the layout files. Tried initially force the role field in the form, but the plugin write the user role in the controllers.
As steinkel posted in this issue: https://github.com/CakeDC/users/issues/513
You must add this line after the pathEntity in /vendor/cakedc/user/src/Controller/Traits/SimpleCrudTrait.php
$entity->role = $this->request->data('role');
Then configure your form to pass the role field. In my case, I passed this information with a select box.
I am using email/password authentication via Firebase, so currently I only have authenticated user and non-authenticated user. But for the app, I would like to have admin, moderator, user and guest four different kinds of role.
I did some research, but could not find any existing example or logic to do so. Here are my initial thoughs, but not sure if it is feasible. Basically two steps:
Create a table in firebase called User, while Firebase record the email/password, I also push the data(email/password), and role information to the table.
In the route, check if the user has the appropriate role to access the certain page
Any other better way to do it? Any idea would be appreciated!
I had similar issue while working with role based authorization. I followed same pattern of saving users role and then retriving it when needed. If you are using ui-router for routes then probably you can use angular-permission module which works on the same concept and is easy to use.
You can find that module here: https://github.com/Narzerus/angular-permission
I am using Easysocial Extension on my Joomla 3.0 site. i was able to successfully install and integrate it. But when ever a user get register i have to approve them to use the site. And don't want to approve every user, i want it in a auto mode. I have tried to Change the option for "New User Account Activation" to "None" under User Manager but No go. I have searcher for other options in Easysocial but not found any.
Can any one help in resolving this issue.
Do the following:
Login to the admin panel of the Joomla Back-end
Go to: Component > Easysocial > Settings > Profile types
Select your members group
Go to the Registration tab
Select Registration Type and Oauth Registration type (various options are there)
This may work, set these preferences in Joomla users > options
Allow user registration - Yes
New user registration Group - Registered
New User Account activation - Self
User will now need to click an activation link which will then authenticate them.
When a user registers on my DNN site I want them to automatically be assigned to a default role. How can I accomplish this?
Thanks in advance.
When you create a role there is a checkbox called 'Auto Assignment' - by checking this users who register are automatically added to this role.
first You need to define the roles and assign them by using the AddUserToRole Method of the role controller.