Download & Extend

Choosing which permissions to display & hide

Project:Please register
Version:6.x-1.3
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:active

Issue Summary

Some permissions do not mean anything to end-users (e.g. using imagecache XYZ preset). It would be great if there were a way to select which permissions we want to display and which we want to hide. If this is not practical, then perhaps it may be possible to display only the custom permissions that we enter using the module's settings page.

Comments

#1

Hi,

is possible. You can write own permissions what you want show or anything what you want...

#2

Im my case, i really don't need the module to take permission list from the actual user permissions. So i just added a new checkbox to the module setting page named "show only custom permissions". When it is checked, module displays only the custom permissions that you write below in the same page.

#3

It would be great if there were a way to select which permissions we want to display and which we want to hide. If this is not practical, then perhaps it may be possible to display only the custom permissions that we enter using the module's settings page.

+1

#4

Thanks for the module, drupaloSa!!

It would still be great to use it with the additional feature to customise the list by chosing the elements to be included.

Plus to give them a hierarchy would alos be useful.

Your suggestion of checking the "show only custom permissions" and adding your own list only works for single language sites. Once you are working with a multi-lingual site it is necessary to use the translations extracted from the permissions table. For this reason it would also be good to specify a hierarchy to keep the same position of the items on the list in all languages.

This would help the developers and so many users who often are bilingual (or use even more languages) these days.

Another way would probably to make the two custom fields multilingual.

Thanks and good luck

#5

subscribe

#6

We can bypass the automatic list generation and only display the Custom ALLOW and Custom DENY permissions by commenting out two lines (172,198) in please_register.module:

I am only displaying the module block for anonymous visitors to encourage them to register. Also note that the first field in the Custom ALLOW list is not displayed..

          if ( variable_get('please_register_anon_what_not_can', 1) == 1 ) {
            $not_can = array_diff($authenticated, $anonymous);
            foreach ($not_can as $v){
//             $ar_not[] = array( theme_image( $path.'/images/delete.png', 'alt', 'title'), t($v) );
            }
          }
       
          // custom deny
 
          if ( ( $please_register_deny_list = variable_get('please_register_deny_list','') ) != ''
             && (
               variable_get('please_register_deny_list_select', 'all') == 'anonymous' ||
               variable_get('please_register_deny_list_select', 'all') == 'all'
             )
          )
          {
            $ar_deny = explode("\n",$please_register_deny_list);
            foreach ($ar_deny as $d) {
              if (($d = trim($d)) != ''){
                $ar_not[] = array( theme_image( $path.'/images/delete.png', 'alt', 'title'), t($d) );
              }
            }
          } 
         
          sort($ar_not);
         
        
          if ( variable_get('please_register_anon_what_can', 1) == 1 ) {
            foreach ($anonymous as $w ){
//              $ar_can[] = array( theme_image( $path.'/images/accept.png', 'alt', 'title'), t($w) );
            }
          }

but it would be nicer in the module admin to be shown a list of possible permissions generated automatically which we can deselect

nobody click here