Morgan Posted May 19, 2016 Report Share Posted May 19, 2016 Hello right so when you our creating groups and i see the list of permissions i want to know how to add custom ones i know how to use them but dont know how to add them so like they our a option in that list etc i have looked throw evey file and sql but nothing please help Quote Link to comment Share on other sites More sharing options...
Moderators servetas Posted May 19, 2016 Moderators Report Share Posted May 19, 2016 Unfortunately it is not possible to add new permissions in the phpVMS system if you do not have the required knowledge to do so. Quote Link to comment Share on other sites More sharing options...
Moderators mark1million Posted May 19, 2016 Moderators Report Share Posted May 19, 2016 Basically you can but you got to know what your doing, you define new permissions in your local config then all the permission to the file you want, example, /** * Library Includes (from 3rd Party) */ # Bit-masks for permission sets $permission_set = array( /*'NO_ADMIN_ACCESS' => 0,*/ 'ACCESS_ADMIN' => 0x1, 'EDIT_NEWS' => 0x2, 'EDIT_PAGES' => 0x4, 'EDIT_DOWNLOADS' => 0x8, 'EMAIL_PILOTS' => 0x10, 'EDIT_AIRLINES' => 0x20, 'EDIT_FLEET' => 0x40, 'EDIT_SCHEDULES' => 0x80, 'IMPORT_SCHEDULES' => 0x100, 'MODERATE_REGISTRATIONS' => 0x200, 'EDIT_PILOTS' => 0x400, 'EDIT_GROUPS' => 0x800, 'EDIT_RANKS' => 0x1000, 'EDIT_AWARDS' => 0x2000, 'MODERATE_PIREPS' => 0x4000, 'EDIT_PIREPS_FIELDS' => 0x8000, 'VIEW_FINANCES' => 0x10000, 'EDIT_EXPENSES' => 0x20000, 'EDIT_SETTINGS' => 0x40000, 'EDIT_PROFILE_FIELDS' => 0x80000, 'EDIT_VACENTRAL' => 0x100000, 'MAINTENANCE' => 0x2000000, 'TRAINING_SYSTEM' => 0x4000000, 'TOUR_SYSTEM' => 0x8000000, 'EVENTS_SYSTEM' => 0x10000000, 'SHOP_SYSTEM' => 0x20000000, //'FULL_ADMIN' => 2147483647 // This is the supposed maximum, however it's still working! 'FULL_ADMIN' => 0x1FFFFFFF ); # Discriptions for permission sets $permission_discription = array( /*'NO_ADMIN_ACCESS' => 0,*/ 'ACCESS_ADMIN' => 'Give a user access to the administration panel. This is required if any other permissions are set.', 'EDIT_NEWS' => '(News & Content) Give a user access to add & edit the news & notams.', 'EDIT_PAGES' => '(News & Content) Give a user access to add & edit the pages.', 'EDIT_DOWNLOADS' => '(News & Content) Give a user access to add & edit the downloads.', 'EMAIL_PILOTS' => '(News & Content) Give a user access to email your pilots.', 'EDIT_AIRLINES' => '(Airline Operations) Give a user access to add & edit your airlines.', 'EDIT_FLEET' => '(Airline Operations) Give a user access to add & edit your fleet.', 'EDIT_SCHEDULES' => '(Airline Operations) Give a user access to add & edit schedules.', 'IMPORT_SCHEDULES' => '(Airline Operations) Give a user access to import and export schedules.', 'MODERATE_REGISTRATIONS' => '(Pilots & Groups) Allow a user to moderate new site registrations.', 'EDIT_PILOTS' => '(Pilots & Groups) Give a user access to edit your pilots.', 'EDIT_GROUPS' => '(Pilots & Groups) Give a user access to add & edit pilot groups. Might aswell just give them full admin.', 'EDIT_RANKS' => '(Pilots & Groups) Give a user access to add & edit ranks.', 'EDIT_AWARDS' => '(Pilots & Groups) Give a user access to add & edit awards.', 'MODERATE_PIREPS' => '(Pilot Reports (PIREPS)) Give a user access to moderate PIREPS', 'EDIT_PIREPS_FIELDS' => '(Pilot Reports (PIREPS)) Give a user access to add and edit PIREPS fields.', 'VIEW_FINANCES' => '(Reports & Expenses) Give a user access to view your finances.', 'EDIT_EXPENSES' => '(Reports & Expenses) Give a user access to edit your expenses.', 'EDIT_SETTINGS' => '(Site & Settings) Give a user access to edit your site settings.', 'EDIT_PROFILE_FIELDS' => '(Site & Settings) Give a user access to add and edit profile fields.', 'EDIT_VACENTRAL' => '(Site & Settings) Give a user access to edit your VACentral Settings.', 'TRAINING_SYSTEM' => 'Gives Access to the Training System', 'TOUR_SYSTEM' => 'Access in to the admin Tours', 'EVENTS_SYSTEM' => 'Grant Access to the Events', 'SHOP_SYSTEM' => 'Grant Access to the Pilot Shop Admin', 'FULL_ADMIN' => 'Full Administration Over-ride. This option will automatically overide all above settings, enabling all of them.' ); Config::Set('permission_set', $permission_set); Config::Set('permission_discription', $permission_discription); define('NO_ADMIN_ACCESS', 0); foreach($permission_set as $key=>$value) { define($key, $value); } foreach($permission_discription as $key=>$value) { define($key.'_DISCRIP', $value); } As you can see i have added permissions for tour system, events system shop system etc etc then in the admin modules you need to add a permissions check like. $this->checkPermission(SHOP_SYSTEM); Basically if you dont know what your doing then leave it alone would be my advise. Quote Link to comment Share on other sites More sharing options...
Morgan Posted May 21, 2016 Author Report Share Posted May 21, 2016 ok thanks you for your advice Quote Link to comment Share on other sites More sharing options...
Morgan Posted May 21, 2016 Author Report Share Posted May 21, 2016 Can someone just give me the code to imput there for a permission called EDIT_ADDONS Basically you can but you got to know what your doing, you define new permissions in your local config then all the permission to the file you want, example, /** * Library Includes (from 3rd Party) */ # Bit-masks for permission sets $permission_set = array( /*'NO_ADMIN_ACCESS' => 0,*/ 'ACCESS_ADMIN' => 0x1, 'EDIT_NEWS' => 0x2, 'EDIT_PAGES' => 0x4, 'EDIT_DOWNLOADS' => 0x8, 'EMAIL_PILOTS' => 0x10, 'EDIT_AIRLINES' => 0x20, 'EDIT_FLEET' => 0x40, 'EDIT_SCHEDULES' => 0x80, 'IMPORT_SCHEDULES' => 0x100, 'MODERATE_REGISTRATIONS' => 0x200, 'EDIT_PILOTS' => 0x400, 'EDIT_GROUPS' => 0x800, 'EDIT_RANKS' => 0x1000, 'EDIT_AWARDS' => 0x2000, 'MODERATE_PIREPS' => 0x4000, 'EDIT_PIREPS_FIELDS' => 0x8000, 'VIEW_FINANCES' => 0x10000, 'EDIT_EXPENSES' => 0x20000, 'EDIT_SETTINGS' => 0x40000, 'EDIT_PROFILE_FIELDS' => 0x80000, 'EDIT_VACENTRAL' => 0x100000, 'MAINTENANCE' => 0x2000000, 'TRAINING_SYSTEM' => 0x4000000, 'TOUR_SYSTEM' => 0x8000000, 'EVENTS_SYSTEM' => 0x10000000, 'SHOP_SYSTEM' => 0x20000000, //'FULL_ADMIN' => 2147483647 // This is the supposed maximum, however it's still working! 'FULL_ADMIN' => 0x1FFFFFFF ); # Discriptions for permission sets $permission_discription = array( /*'NO_ADMIN_ACCESS' => 0,*/ 'ACCESS_ADMIN' => 'Give a user access to the administration panel. This is required if any other permissions are set.', 'EDIT_NEWS' => '(News & Content) Give a user access to add & edit the news & notams.', 'EDIT_PAGES' => '(News & Content) Give a user access to add & edit the pages.', 'EDIT_DOWNLOADS' => '(News & Content) Give a user access to add & edit the downloads.', 'EMAIL_PILOTS' => '(News & Content) Give a user access to email your pilots.', 'EDIT_AIRLINES' => '(Airline Operations) Give a user access to add & edit your airlines.', 'EDIT_FLEET' => '(Airline Operations) Give a user access to add & edit your fleet.', 'EDIT_SCHEDULES' => '(Airline Operations) Give a user access to add & edit schedules.', 'IMPORT_SCHEDULES' => '(Airline Operations) Give a user access to import and export schedules.', 'MODERATE_REGISTRATIONS' => '(Pilots & Groups) Allow a user to moderate new site registrations.', 'EDIT_PILOTS' => '(Pilots & Groups) Give a user access to edit your pilots.', 'EDIT_GROUPS' => '(Pilots & Groups) Give a user access to add & edit pilot groups. Might aswell just give them full admin.', 'EDIT_RANKS' => '(Pilots & Groups) Give a user access to add & edit ranks.', 'EDIT_AWARDS' => '(Pilots & Groups) Give a user access to add & edit awards.', 'MODERATE_PIREPS' => '(Pilot Reports (PIREPS)) Give a user access to moderate PIREPS', 'EDIT_PIREPS_FIELDS' => '(Pilot Reports (PIREPS)) Give a user access to add and edit PIREPS fields.', 'VIEW_FINANCES' => '(Reports & Expenses) Give a user access to view your finances.', 'EDIT_EXPENSES' => '(Reports & Expenses) Give a user access to edit your expenses.', 'EDIT_SETTINGS' => '(Site & Settings) Give a user access to edit your site settings.', 'EDIT_PROFILE_FIELDS' => '(Site & Settings) Give a user access to add and edit profile fields.', 'EDIT_VACENTRAL' => '(Site & Settings) Give a user access to edit your VACentral Settings.', 'TRAINING_SYSTEM' => 'Gives Access to the Training System', 'TOUR_SYSTEM' => 'Access in to the admin Tours', 'EVENTS_SYSTEM' => 'Grant Access to the Events', 'SHOP_SYSTEM' => 'Grant Access to the Pilot Shop Admin', 'FULL_ADMIN' => 'Full Administration Over-ride. This option will automatically overide all above settings, enabling all of them.' ); Config::Set('permission_set', $permission_set); Config::Set('permission_discription', $permission_discription); define('NO_ADMIN_ACCESS', 0); foreach($permission_set as $key=>$value) { define($key, $value); } foreach($permission_discription as $key=>$value) { define($key.'_DISCRIP', $value); } As you can see i have added permissions for tour system, events system shop system etc etc then in the admin modules you need to add a permissions check like. $this->checkPermission(SHOP_SYSTEM); Basically if you dont know what your doing then leave it alone would be my advise. Quote Link to comment Share on other sites More sharing options...
Moderators mark1million Posted May 21, 2016 Moderators Report Share Posted May 21, 2016 Ok copy your permission sets below from your config or local config in the core, plus copy the add on from the admin module you want to add the permission to and ill have a look. Quote Link to comment Share on other sites More sharing options...
Morgan Posted May 21, 2016 Author Report Share Posted May 21, 2016 # Bit-masks for permission sets $permission_set = array (/*'NO_ADMIN_ACCESS' => 0,*/ 'EDIT_NEWS' => 0x1, 'EDIT_PAGES' => 0x2, 'EDIT_DOWNLOADS' => 0x4, 'EMAIL_PILOTS' => 0x8, 'EDIT_AIRLINES' => 0x10, 'EDIT_FLEET' => 0x20, 'EDIT_SCHEDULES' => 0x80, 'IMPORT_SCHEDULES' => 0x100, 'MODERATE_REGISTRATIONS' => 0x200, 'EDIT_PILOTS' => 0x400, 'EDIT_GROUPS' => 0x800, 'EDIT_RANKS' => 0x1000, 'EDIT_AWARDS' => 0x2000, 'MODERATE_PIREPS' => 0x4000, 'VIEW_FINANCES' => 0x8000, 'EDIT_EXPENSES' => 0x10000, 'EDIT_SETTINGS' => 0x20000, 'EDIT_PIREPS_FIELDS' => 0x40000, 'EDIT_PROFILE_FIELDS' => 0x80000, 'EDIT_VACENTRAL' => 0x100000, 'ACCESS_ADMIN' => 0x2000000, 'FULL_ADMIN' => 35651519); Config::Set('permission_set', $permission_set); define('NO_ADMIN_ACCESS', 0); foreach($permission_set as $key=>$value) { define($key, $value); } <?php } ?> <?php if(strlen($MODULE_NAV_INC) > 0) { ?> <li style="padding: 0; margin: 0;"><a class="menu" href="#"> <img src="<?php echo SITE_URL?>/admin/lib/layout/images/settings_icon.gif" />Addons</a> <ul style="padding: 0; margin: 0;"> <?php echo $MODULE_NAV_INC; ?> </ul> </li> <?php } ?> Quote Link to comment Share on other sites More sharing options...
Moderators mark1million Posted May 21, 2016 Moderators Report Share Posted May 21, 2016 Ok so under the line 'EDIT_FLEET' => 0x20, add 'EDIT_ADDONS' => 0x40, Then i need to see the addons module in the Admin>modules folder because you need to add the permission in there for it to check. Plus you also need to add the description for that permission as well or your dropdown will be blank. so add it in here # Discriptions for permission sets $permission_discription = array( /*'NO_ADMIN_ACCESS' => 0,*/ 'ACCESS_ADMIN' => 'Give a user access to the administration panel. This is required if any other permissions are set.', 'EDIT_NEWS' => '(News & Content) Give a user access to add & edit the news & notams.', 'EDIT_PAGES' => '(News & Content) Give a user access to add & edit the pages.', 'EDIT_DOWNLOADS' => '(News & Content) Give a user access to add & edit the downloads.', 'EMAIL_PILOTS' => '(News & Content) Give a user access to email your pilots.', Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.