Forum permission not showing in group forum permissions

Discussion forum for Extension Writers regarding Extension Development.
User avatar
danieltj
Infrastructure Team Member
Infrastructure Team Member
Posts: 666
Joined: Thu May 03, 2018 9:32 pm
Location: United Kingdom
Name: Daniel James

Forum permission not showing in group forum permissions

Post by danieltj »

I've created a new permission for an extension that needs to add said permission for forums. This is what it looks like in the event listener:

Code: Select all

$event->update_subarray( 'permissions', 'u_send_super_posts', [
    'lang' => 'ACL_U_SEND_SUPER_POSTS',
    'cat' => 'post'
] );
I need it added to the Post tab.

When I go to ACP :arrow: Permissions :arrow: Forum roles, I can see the new permission in the Post tab as I expect.

However, when I go to ACP :arrow: Users and Groups :arrow: Group forum permissions, I can't see the new permission at all and I'm kinda lost really because I don't know why it isn't working. What have I done wrong here?
MY EXTENSIONS:
Verified Profiles | Awesome Payments: a phpBB shop

Available for paid extension work: PM me.
User avatar
danieltj
Infrastructure Team Member
Infrastructure Team Member
Posts: 666
Joined: Thu May 03, 2018 9:32 pm
Location: United Kingdom
Name: Daniel James

Re: Forum permission not showing in group forum permissions

Post by danieltj »

db-acl-options-new-perm.png

I had a look into the permissions table acl_options and it seems as though changing the status of the permission from global to local seemed to work and it now appears as it should. Having said that, is there any reason why that has happened in the first place?
You do not have the required permissions to view the files attached to this post.
MY EXTENSIONS:
Verified Profiles | Awesome Payments: a phpBB shop

Available for paid extension work: PM me.
User avatar
Brf
Support Team Member
Support Team Member
Posts: 53599
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}

Re: Forum permission not showing in group forum permissions

Post by Brf »

Forum permissions, by definition, are always local. Admin and User permissions are always Global. Only Moderator permissions can both global and/or local.

In your first post, your permission has a "u_" prefix. I would have expected it to be a user permission, which is global.
User avatar
danieltj
Infrastructure Team Member
Infrastructure Team Member
Posts: 666
Joined: Thu May 03, 2018 9:32 pm
Location: United Kingdom
Name: Daniel James

Re: Forum permission not showing in group forum permissions

Post by danieltj »

Brf wrote: Mon Dec 30, 2024 9:10 pm In your first post, your permission has a "u_" prefix. I would have expected it to be a user permission, which is global.
Yeah I noticed that after I posted and updated to f_ which got me half way there.

I managed to get it working after updating my migration file. When you add a new permission there was a surprise argument I didn't realise default to true (global) that you need to explicitly set to false.

Code: Select all

[ 'permission.add', [ 'f_send_super_posts', false ] ],
The above fixed it. Now it works without any problems.

🙂
MY EXTENSIONS:
Verified Profiles | Awesome Payments: a phpBB shop

Available for paid extension work: PM me.

Return to “Extension Writers Discussion”