protected function getStandardPermissions(array $options, $master, $owner)
    {
        switch ($options['permissions']) {
            case 'standard::object':
                $disable = array ();
                // if not owner or master, disable all permissions
                if (!$master && !$owner) {
                    $disable = array (1, 3, 4, 6, 7, 8);
                }
                // if not master, disable
                // 5 -> undelete is not used
                return array (
                    'show' => array (
                        1 => 'View',
                        3 => 'Edit',
                        4 => 'Delete',
                        6 => 'Operator',
                        7 => 'Master',
                        8 => 'Owner'
                    ),
                    'disable' => $disable);
                break;
            case 'standard::class':
                return array (
                    'show' => array (
                        1 => 'View',
                        2 => 'Create',
                        3 => 'Edit',
                        4 => 'Delete',
                        6 => 'Operator',
                        7 => 'Master',
                        8 => 'Owner'
                ));
                break;
            default:
                throw new \RuntimeException('"' . $options['permissions'] .
                '" is not a valid standard permission set identifier');
        }
    }
protected function getStandardPermissions(array $options, $master, $owner)
    {
        switch ($options['permissions']) {
            case 'standard::object':
                $disable = array ();
                // if not owner or master, disable all permissions
                if (!$master && !$owner) {
                    $disable = array (1, 3, 4, 6, 7, 8);
                }
                // if not master, disable
                // 5 -> undelete is not used
                return array (
                    'show' => array (
                        1 => 'View',
                        3 => 'Edit',
                        4 => 'Delete',
                        6 => 'Operator',
                        7 => 'Master',
                        8 => 'Owner'
                    ),
                    'disable' => $disable);
                break;
            case 'standard::class':
                return array (
                    'show' => array (
                        1 => 'View',
                        2 => 'Create',
                        3 => 'Edit',
                        4 => 'Delete',
                        6 => 'Operator',
                        7 => 'Master',
                        8 => 'Owner'
                ));
                break;
            default:
                throw new \RuntimeException('"' . $options['permissions'] .
                '" is not a valid standard permission set identifier');
        }
    }
protected function getStandardPermissions ( array $ options , $ master , $ owner ) { switch ( $ options [ 'permissions' ] ) { case 'standard::object' : $ disable = array ( ) ; // if not owner or master, disable all permissions if ( ! $ master && ! $ owner ) { $ disable = array ( 1 , 3 , 4 , 6 , 7 , 8 ) ; } // if not master, disable // 5 -> undelete is not used return array ( 'show' => array ( 1 => 'View' , 3 => 'Edit' , 4 => 'Delete' , 6 => 'Operator' , 7 => 'Master' , 8 => 'Owner' ) , 'disable' => $ disable ) ; break ; case 'standard::class' : return array ( 'show' => array ( 1 => 'View' , 2 => 'Create' , 3 => 'Edit' , 4 => 'Delete' , 6 => 'Operator' , 7 => 'Master' , 8 => 'Owner' ) ) ; break ; default : throw new \ RuntimeException ( '"' . $ options [ 'permissions' ] . '" is not a valid standard permission set identifier' ) ; } }
Get standard permission sets for provided string identifier.

Returns an array with an array of permissions to show (['show']) and an
array with permissions which should be disabled (that means, still shown,
but uneditable) (['disable']).

@param  array  $options Form options
@param  [type] $master  is master permission assumed?
@param  [type] $owner   is owner permission assumed?
@return [type]          Array with permissions to show and disable
Get standard permission sets for provided string identifier .