• This is a read only backup of the old Emudevs forum. If you want to have anything removed, please message me on Discord: KittyKaev

[SOLVED] [Trinity] How to create custom Security Levels on RBAC?

Status
Not open for further replies.

Synth

Exalted Member
Hello Emudevs,as title say i want to know how i can create custom security levels on RBAC (Least rev),les't say i want to create 1 security level called "Owner",what i should do for i get this rank and i want for this rank get whole permissions commands access?

Can anyone help me ?

Thank you!
Best regards,
Synth !
 

Shaorin

Respected Member
hmmm can't you just add it ti the source code like you needed to do in the older version to get more ranks like, mod, dev, owner, vip and so on. i think you jsut do the some now. i'm not sure cusz i don't know C++ i have just some thoughts i may be wrong but i don't think so.
 

Tommy

Founder
We have to sleep like everyone else, be patient for help.

Anyway, I told you how to do this before.

Go to 'Common.h' and add your custom security level in "enum AccountTypes". Since SEC_CONSOLE has to be changed to 5, I believe in your world database -> command table, you have to change the values in the permission column to 5 considering you moved SEC_CONSOLE to 5.

This can be easily done by doing:

Code:
UPDATE `command` SET permission='5' WHERE permission='4'

My AccountTypes:

Code:
enum AccountTypes
{
    SEC_PLAYER         = 0,
    SEC_MODERATOR      = 1,
    SEC_GAMEMASTER     = 2,
    SEC_ADMINISTRATOR  = 3,
    SEC_CUSTOM         = 4,
    SEC_CONSOLE        = 5,                                  // must be always last in list, accounts must have less security level always also
};

Inside of the world database -> command table, you can add your custom 'VIP' or whatever custom commands you have for your new security group. If you want your custom group to have a player sec level, you can add them in rbac_linked_permissions.

In rbac_permissions, I have a custom permission '191':

Code:
INSERT INTO rbac_permissions VALUES ('191', 'Role: Sec Level Custom');

I linked Player Sec Level to my custom permission. This gives me the player commands:

Code:
INSERT INTO rbac_linked_permissions VALUES ('191', '195');

Inside of "rbac_default_permissions" I added my custom group, secId 5 (custom):

Code:
INSERT INTO rbac_default_permissions VALUES ('5', '191');

Lastly, I added it to my account (2) in "rbac_account_permissions":

Code:
INSERT INTO rbac_account_permissions VALUES ('2', '191', '1', '-1');

To test to see if my custom group worked, I linked GameMaster Sec Level to my custom permission '191'. Sure enough, my test worked.

ofqa.png


Just some information I found out about RBAC. If your commands are working fine on any security group and you restart the server then come back online to find that your commands don't work anymore, that's RBAC, not you or your custom permissions.
 

Synth

Exalted Member
We have to sleep like everyone else, be patient for help.

Anyway, I told you how to do this before.

Go to 'Common.h' and add your custom security level in "enum AccountTypes". Since SEC_CONSOLE has to be changed to 5, I believe in your world database -> command table, you have to change the values in the permission column to 5 considering you moved SEC_CONSOLE to 5.

This can be easily done by doing:

My AccountTypes:

Inside of the world database -> command table, you can add your custom 'VIP' or whatever custom commands you have for your new security group. If you want your custom group to have a player sec level, you can add them in rbac_linked_permissions.

In rbac_permissions, I have a custom permission '191':

I linked Player Sec Level to my custom permission. This gives me the player commands:

Inside of "rbac_default_permissions" I added my custom group, secId 5 (custom):

Lastly, I added it to my account (2) in "rbac_account_permissions":

To test to see if my custom group worked, I linked GameMaster Sec Level to my custom permission '191'. Sure enough, my test worked.

ofqa.png


Just some information I found out about RBAC. If your commands are working fine on any security group and you restart the server then come back online to find that your commands don't work anymore, that's RBAC, not you or your custom permissions.
Thanks man now its working :smile:
Don't closed please maybe i will get a problem with something when i'm sure everything its fine i will tell you to close this thread thanks for your time :smile:
 

Synth

Exalted Member
I have a last question about this and you can closed after: i make 2 new security level and i have a question about first query so: it should be like this ?
"Common.h"
Code:
enum AccountTypes
{
    SEC_PLAYER         = 0,
    SEC_MODERATOR      = 1,
    SEC_GAMEMASTER     = 2,
    SEC_ADMINISTRATOR  = 3,
    SEC_CUSTOM         = 4,
    SEC_VIP                = 5,
    SEC_CONSOLE        = 6,                                  // must be always last in list, accounts must have less security level always also
};
The first query should be like that?
Code:
-- Console
UPDATE `command` SET permission='6' WHERE permission='4'

Code:
-- VIP
UPDATE `command` SET permission='6' WHERE permission='5'
 

Tommy

Founder
I have a last question about this and you can closed after: i make 2 new security level and i have a question about first query so: it should be like this ?
"Common.h"
Code:
enum AccountTypes
{
    SEC_PLAYER         = 0,
    SEC_MODERATOR      = 1,
    SEC_GAMEMASTER     = 2,
    SEC_ADMINISTRATOR  = 3,
    SEC_CUSTOM         = 4,
    SEC_VIP                = 5,
    SEC_CONSOLE        = 6,                                  // must be always last in list, accounts must have less security level always also
};
The first query should be like that?
Code:
-- Console
UPDATE `command` SET permission='6' WHERE permission='4'

Code:
-- VIP
UPDATE `command` SET permission='6' WHERE permission='5'

If you have custom VIP commands, why are you changing VIP permission 5 to console permission 6?

Console should be 6, which you have a query for, but I don't get the point of the second query unless some console commands were permission 5.
 

Synth

Exalted Member
Code:
enum AccountTypes
{
    SEC_PLAYER         = 0,
    SEC_MODERATOR      = 1,
    SEC_GAMEMASTER     = 2,
    SEC_ADMINISTRATOR  = 3,
    SEC_EM        = 4,
    SEC_VIP                = 5,
    SEC_CONSOLE        = 6,                                  // must be always last in list, accounts must have less security level always also
};
The first query should be like that?
Code:
-- EM
UPDATE `command` SET permission='6' WHERE permission='4'

Code:
-- VIP
UPDATE `command` SET permission='6' WHERE permission='5'
Check this,i do wrong with query's on the previous post but i think now its fine?
 

Tommy

Founder
What are you talking about? You basically copied and pasted your other post. You shouldn't be changing the console permission at all unless you go to 7, 8, etc. Everything you're doing should be fine, as long as you don't overwrite the 1, 2, 3 permissions.
 

Synth

Exalted Member
What are you talking about? You basically copied and pasted your other post. You shouldn't be changing the console permission at all unless you go to 7, 8, etc. Everything you're doing should be fine, as long as you don't overwrite the 1, 2, 3 permissions.
I know i don't have to change console but i mean i need to add add each security the command query like that?
Code:
-- EM
UPDATE `command` SET permission='6' WHERE permission='4'
Code:
-- VIP
UPDATE `command` SET permission='6' WHERE permission='5'
 

Tommy

Founder
I don't get why you're running those queries. Those won't do anything.

Let's say you added a custom command with permission 6, SEC_CONSOLE has to be 7 now, that's when you'll run:

Code:
UPDATE `command` SET `permission`=7 WHERE `permission`=6

However, if you want to change your custom permission and you have custom commands for it, that's when you'd run the commands you're running. Other than that, you shouldn't be updating anything in the world->command table unless you add a new command, change your security level ID, etc. Stop running queries in the command table unless they are really needed (i.e. SEC_CONSOLE is a higher securityLevel, you added a custom command, etc). You should be fine now.
 
Status
Not open for further replies.
Top