public function getPermissions()
    {
        // user permissions overridden from role.
        $permissions = \Cache::remember(
            'acl.getPermissionsById_'.$this->id,
            config('acl.cacheMinutes'),
            function () {
                return $this->getPermissionsInherited();
            }
        );

        // permissions based on role.
        // more permissive permission wins
        // if user has multiple roles we keep
        // true values.
        foreach ($this->roles as $role) {
            foreach ($role->getPermissions() as $slug => $array) {
                if ( array_key_exists($slug, $permissions) ) {
                    foreach ($array as $clearance => $value) {
                        if( !array_key_exists( $clearance, $permissions[$slug] ) ) {
                            ! $value ?: $permissions[$slug][$clearance] = true;
                        }
                    }
                } else {
                    $permissions = array_merge($permissions, [$slug => $array]);
                }
            }
        }

        return $permissions;
    }
public function getPermissions()
    {
        // user permissions overridden from role.
        $permissions = \Cache::remember(
            'acl.getPermissionsById_'.$this->id,
            config('acl.cacheMinutes'),
            function () {
                return $this->getPermissionsInherited();
            }
        );

        // permissions based on role.
        // more permissive permission wins
        // if user has multiple roles we keep
        // true values.
        foreach ($this->roles as $role) {
            foreach ($role->getPermissions() as $slug => $array) {
                if ( array_key_exists($slug, $permissions) ) {
                    foreach ($array as $clearance => $value) {
                        if( !array_key_exists( $clearance, $permissions[$slug] ) ) {
                            ! $value ?: $permissions[$slug][$clearance] = true;
                        }
                    }
                } else {
                    $permissions = array_merge($permissions, [$slug => $array]);
                }
            }
        }

        return $permissions;
    }
public function getPermissions ( ) { // user permissions overridden from role. $ permissions = \ Cache :: remember ( 'acl.getPermissionsById_' . $ this -> id , config ( 'acl.cacheMinutes' ) , function ( ) { return $ this -> getPermissionsInherited ( ) ; } ) ; // permissions based on role. // more permissive permission wins // if user has multiple roles we keep // true values. foreach ( $ this -> roles as $ role ) { foreach ( $ role -> getPermissions ( ) as $ slug => $ array ) { if ( array_key_exists ( $ slug , $ permissions ) ) { foreach ( $ array as $ clearance => $ value ) { if ( ! array_key_exists ( $ clearance , $ permissions [ $ slug ] ) ) { ! $ value ? : $ permissions [ $ slug ] [ $ clearance ] = true ; } } } else { $ permissions = array_merge ( $ permissions , [ $ slug => $ array ] ) ; } } } return $ permissions ; }
Get all user permissions including
user all role permissions.

@return array|null
Get all user permissions including user all role permissions .