We build. You grow.

Get best community software here

Start a social network, a fan-site, an education project with oxwall - free opensource community software

How to add a new role to All users? | Forum

Topic location: Forum home » Support » General Questions
Petre Marian
Petre Marian Sep 30 '17
Hello,

Any ideea how to add a role to all users? of course not manual... :) 

Perhaps in mysql?

Also what is happening if (after a period 30 day's) I delete that role?

The true and real question is how  to add a role to all users but not to users who have a certain role.

if a user have only free role will be added to the new role but if a user have a free and VIP role will not be added to the new role.

Also can I do/run this filter regulary? (manual when I wan to do this or when I remember)


Thank you.


The Forum post is edited by Petre Marian Sep 30 '17
ArtMedia
ArtMedia Sep 30 '17
oxwall PA don't have option mass adding certain role to users, you can do everyting via mysql, or hire developer to create pugin for you.
Petre Marian
Petre Marian Sep 30 '17
Any body have any ideea how to do this in mysql?

I found this on skadate site can anybody confirm me if is ok to do this?

To grant one user role to ALL your user at once via datbase you need to:

1. Choose the role you will be granting.

Open ow_base_authorization_role database table. Here you will see list of your roles with their IDs. Remember the role ID you wish to give to all your users. In our example we will remember role ID = 12 ( which is usually a default free user role that comes with standard SkaDate / Oxwall installation).

2. Grant selected role.

Open ow_base_authorization_user_role database table.
Click “SQL” tab in your PhpMyAdmin interface.
Insert following query:

INSERT IGNORE INTO `ow_base_authorization_user_role` (`userId`, `roleId`) SELECT `id`, 12 FROM `ow_base_user`

Where 12 is the role ID which will be granted to all your users.

And you are done.


The real trick is how to add the new role only to certain users. Or to all users but NOT to users who have some role assigned.?????

The Forum post is edited by Petre Marian Oct 5 '17