Skip to content

studios-neptune/permissions

Repository files navigation

Package

  • no more before
Gate::before(function (User $user) {
    if ($user->isAdmin()) {
        return true;
    }
});
  • simplify code in policies
public function view(User $auth, User $user): bool
{
    return $auth->isStaff() || $user->is($auth);
}

Installation

    "repositories": {
        "studios-neptune/permissions": {
            "type": "vcs",
            "url": "[email protected]:studios-neptune/permissions.git"
        },
    },
composer require studios-neptune/permissions

Dev

composer install
composer install --working-dir tools/php-cs-fixer

Requirements

  • user->permissions as intersection of all user role permissions and from user permissions
  • user->hasPermission(string $permission)
  • user->hasAllPermissions(array $permissions)
  • user->hasAnyPermissions(array $permissions)

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published