hiraeth/auth

RBAC/ACL auth for the Hiraeth Nano-Framework

Installs: 7 461

Dependents: 1

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 0

Open Issues: 0

Type:opus-package

3.0-beta 2024-03-15 19:02 UTC

This package is auto-updated.

Last update: 2024-12-15 20:37:23 UTC


README

Imarc's RBAC/ACL implementation provides robust role-based authentication and configuration of permissions which can be checked dynamically on any entity as well as by providing configuration based access control lists.

Installation

composer require hiraeth/auth

The auth.jin configuration will be automatically copied to your config directory via opus.

Delegates

No delegates are included in this package.

Providers

Configuration

[auth]

; Aliases enable to combination of multiple permitted actions into a single
; action.  The key is the alias for the actions and the value is an array of
; actions which it also permits.

aliases = {
;	"manage": ["create", "read", "update", "delete"]
}

; Access control lists.  Each entry in the acls list is keyed by the role.
; The value is then an object containing permitted actions (arrays of actions)
; for the keyed targets.

acls = {
;	"admin": {
;		"User" : ["manage"]
;	}
}

The [auth] section is globally recognized, so it can be added to any configuration file in the system to add additional roles and permissions. Each [auth] section constitutes a distinct ACL, so aliases will only apply to the acls defined in the same section.

Usage

See the Auth documentation for more information on how to use the auth manager and check roles/permissions.