Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

List all your permissions

Comments in 'Resources' started by Tim // robske Büba, Feb 5, 2016.

  1. Tim // robske Büba
    Offline

    Tim // robske Büba Notable Member

    Joined:
    Feb 26, 2014
    Posts:
    606
    Minecraft User:
    robske_110
    Many people keep posting under every plugin "What are the perms" etc.
    This simple code/plugin can list all your permissions on the server with description (for setting up Permission Plugins etc.):
    You can choose to spam the console:
    PHP:
            {
                case 
    "permList":
                
    $permArray $this->getServer()->getPluginManager()->getPermissions(); //Gets all permissions objects
                
    $permName_DescArray NULL;
                
    $INDEX 0;
                foreach(
    $permArray as $perm)
                {
                    
    $permName_DescArray[$INDEX] = "Permission: ".$perm->getName()." Description: ".$perm->getDescription(); //Message parsing
                    
    $INDEX++;
                }
                
    $this->getServer()->getLogger()->info(implode(" \n ",$permName_DescArray));
            return 
    true;
            }
    or make an almost unreadable text:
    PHP:
            {
                case 
    "permList":
                
    $permArray $this->getServer()->getPluginManager()->getPermissions(); //Gets all permissions objects
                
    $permName_DescArray NULL;
                
    $INDEX 0;
                foreach(
    $permArray as $perm)
                {
                    
    $permName_DescArray[$INDEX] = "Permission: ".$perm->getName()." Description: ".$perm->getDescription(); //Message parsing
                    
    $INDEX++;
                }
                
    $this->getServer()->getLogger()->info(implode(" // ",$permName_DescArray));
            return 
    true;
            }
    Please tell me if this contains an bad practise!
    Last edited: Feb 5, 2016

Share This Page

Advertisement