src/Traits/HasRolesAndPermissions.php
public function hasPermission($permission)
    {
        $permission = !is_string($permission) ?: Permission::where(['slug' => $permission])->first();
        
        if (config('laralum.superadmin_bypass_haspermission')) {
            return true;
        }
        
        if ($permission) {
            foreach ($this->roles as $role) {
                if ($role->hasPermission($permission)) {
                    return true;
                }
            }
        }

        return false;
    }
public function hasPermission($permission)
    {
        $permission = !is_string($permission) ?: Permission::where(['slug' => $permission])->first();
        
        if (config('laralum.superadmin_bypass_haspermission')) {
            return true;
        }
        
        if ($permission) {
            foreach ($this->roles as $role) {
                if ($role->hasPermission($permission)) {
                    return true;
                }
            }
        }

        return false;
    }
public function hasPermission ( $ permission ) { $ permission = ! is_string ( $ permission ) ? : Permission :: where ( [ 'slug' => $ permission ] ) -> first ( ) ; if ( config ( 'laralum.superadmin_bypass_haspermission' ) ) { return true ; } if ( $ permission ) { foreach ( $ this -> roles as $ role ) { if ( $ role -> hasPermission ( $ permission ) ) { return true ; } } } return false ; }
Returns true if the role has a permission.

@param mixed $role

@return bool
Returns true if the role has a permission .