Custom Permissions

Discussion forum for Extension Writers regarding Extension Development.
Post Reply
alexander7566
Registered User
Posts: 171
Joined: Mon Mar 12, 2012 5:26 pm

Custom Permissions

Post by alexander7566 »

I updated to 3.17 a while back and I just now noticed that none of my custom permissions are showing in the acp. Turns out my permissions_foo.php file was missing. I went to readd it, but I noticed that the folder language/en/mods no longer existed. So I created the folder and re-added the file. Cleared the cache. However, the permissions are still not showing up. Below is an example of the file.

Any ideas on why this is not showing up in the new admin panel? There is not much documentation on this as far as the new 3.1x.

Code: Select all

<?php
/**
 * DO NOT CHANGE
 */
if (!defined('IN_PHPBB'))
{
	exit;
}

if (empty($lang) || !is_array($lang))
{
	$lang = array();
}

// Adding the permissions
$lang['permission_cat']['msw'] = 'MSW - General';
$lang = array_merge($lang, array(
));
$lang['permission_cat']['msw_staff_chat'] = 'MSW - Staff - Chat';
$lang = array_merge($lang, array(
		'acl_u_chat_mute'    => array('lang' => 'Can mute players from chat', 'cat' => 'msw_staff_chat'),
		'acl_u_staff_chat_delete'    => array('lang' => 'Can delete chat messages', 'cat' => 'msw_staff_chat'),
));

...
Edit: More details added.. Read my latest post viewtopic.php?f=46&t=2384336&p=14507426#p14507426
Last edited by alexander7566 on Thu Aug 25, 2016 4:51 pm, edited 2 times in total.
alexander7566
Registered User
Posts: 171
Joined: Mon Mar 12, 2012 5:26 pm

Re: Custom Permissions

Post by alexander7566 »

I have no clue how this happened but I apparently posted it in 3.0 instead of 3.1. If a moderator could move this to the correct forum and delete this post that would be great. thanks.
User avatar
Lumpy Burgertushie
Registered User
Posts: 68294
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: Custom Permissions

Post by Lumpy Burgertushie »

however, in 3.1 there are no longer mod folders. it doesn't need them since no 3.0 MODs will work in 3.1

that file looks like it belongs to some type of chat script. that is probably not going to work at all in 3.1.


robert
I'm baaaaaccckkkk. still doing work on donation basis. PM your needs.

Premium phpBB 3.3 Styles by PlanetStyles.net

If nobody is in the forest, does a tree really fall?
alexander7566
Registered User
Posts: 171
Joined: Mon Mar 12, 2012 5:26 pm

Re: Custom Permissions

Post by alexander7566 »

Okay, so I have dug into it a little deeper and was able to remember a few more details.

The permissions_foo.php file is a language file that I created to display the permission descriptions when I am trying to set permissions for a user. I found that I can move the file to /includes/acp/permissions_foo.php and it will get called as it should.

I have added permission options in the DB table phpbb_acl_options. From that point (after clearing the cache too of course) those should show up as options when setting a user's or group's permissions. However, since the update, they are not (they use to on version 3.0.x). Anyone know why they are not showing up as a permission option in 3.1.7?
User avatar
Lumpy Burgertushie
Registered User
Posts: 68294
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: Custom Permissions

Post by Lumpy Burgertushie »

because 3.1 is basically a complete rewrite of the code from 3.0 and little, if anything, from 3.0 will work with 3.1

robert
I'm baaaaaccckkkk. still doing work on donation basis. PM your needs.

Premium phpBB 3.3 Styles by PlanetStyles.net

If nobody is in the forest, does a tree really fall?
alexander7566
Registered User
Posts: 171
Joined: Mon Mar 12, 2012 5:26 pm

Re: Custom Permissions

Post by alexander7566 »

Either way, PhpBB still has to store the permissions available somewhere.. But where? All the permissions in my app are working properly still, so PhpBB is still returning the user as having those permissions, but I am just unable to edit who has what permission.
User avatar
stevemaury
Support Team Member
Support Team Member
Posts: 51674
Joined: Thu Nov 02, 2006 12:21 am
Location: The U.P.
Name: Steve
Contact:

Re: Custom Permissions

Post by stevemaury »

The problem we have here is you have a 3.0 MOD (and not an approved MOD from our database), and you want to adapt it to 3.1. There is no support for any 3.0 MODs, there is no support for unapproved MODs, and there is no support in the 3.1 support forum for adapting 3.0 MODs to 3.1. Your best bet is in the Extension writers' discussion forum, where I will move this topic.
For REALLY good and VERY inexpensive hosting CLICK HERE

I can stop all your spam. I can upgrade or update your Board. PM or email me. (Paid support)
alexander7566
Registered User
Posts: 171
Joined: Mon Mar 12, 2012 5:26 pm

Re: Custom Permissions

Post by alexander7566 »

Okay.. so it's not going to work with 3.1. Understood. Here is the documentation for what I am doing, but I assume it's the 3.0 documentation since everyone is telling me nothing is the same.

https://wiki.phpbb.com/Tutorial.Permissions

Could someone point me to the documentation page for extension permissions in 3.1.
alexander7566
Registered User
Posts: 171
Joined: Mon Mar 12, 2012 5:26 pm

Re: Custom Permissions

Post by alexander7566 »

I looked up other extensions at how they did permissions and I was able to figure it out. Not that hard to change over.. Just could not find any documentation on it.
Attachments
Capture.PNG
Post Reply

Return to “Extension Writers Discussion”