Simple Machines Community Forum

Customizing SMF => SMF Coding Discussion => Aiheen aloitti: Harry D - elokuu 06, 2013, 08:48:43 IP

Otsikko: Adding a Custom permission
Kirjoitti: Harry D - elokuu 06, 2013, 08:48:43 IP
Morning (From the UK),

Don't know if this has already been posted, but can't seem to find this information anywhere else. If you are wanting to add a custom permission, how do you do it? This is for like a moderator permission, but different I don't want to copy the permission, so it then edits the main one.

Thanks in advance,

Harry.
Otsikko: Re: Adding a Custom permission
Kirjoitti: Kindred - elokuu 07, 2013, 12:23:45 AP
adding a permission in what regard?

Adding it to the permissions list is simple.

However, you then have to have some code that checks and makes use of the new permission...
and that can get more complicated.

So, you need to give more details on what you are trying to accomplish.
(note, also moving this to the coding board)
Otsikko: Re: Adding a Custom permission
Kirjoitti: Harry D - elokuu 07, 2013, 11:35:36 AP
Hello,

Yes I am wanting to make a new permission, which as you said looks like I'd require some more code. I don't want to clone it from another permission such as 'Administrator' & 'Moderator' etc.

Harry
Otsikko: Re: Adding a Custom permission
Kirjoitti: Arantor - elokuu 10, 2013, 07:41:43 IP
Adding the permission is easy. There's even a tutorial for it. But what do you want the permission to *do*?
Otsikko: Re: Adding a Custom permission
Kirjoitti: Chalky - elokuu 11, 2013, 03:08:10 AP
Administrator and (Global) Moderator are not permissions, they are membergroups. Permissions such as "can edit own profile", "can access arcade" are then assigned to membergroups to determine what the members placed in those membergroups are able to do.

So I can't help but ask: do you want to create a new permission or a new membergroup?