Download the PHP package gusmanwidodo/auth-kit-organization without Composer

On this page you can find all versions of the php package gusmanwidodo/auth-kit-organization. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package auth-kit-organization

Auth-Kit Organization

Organization (multi-tenant) plugin for Auth-Kit. Organizations, members, invitations, and an active organization per session — with owner / admin / member implemented as organization-scoped roles powered by auth-kit-permissions.

Tests

What it demonstrates

This is the plugin that proves the Auth-Kit ecosystem composes: instead of re-implementing role-based access control, it consumes auth-kit-permissions and its polymorphic scope. Creating an organization bootstraps three roles scoped to that organization, and every authorization check flows through the permissions plugin's PermissionManager with Scope::for('organization', $id).

See ADR 003 for the design rationale (organization as a consumer, not a second RBAC system).

Requirements

Installation

All three packages (core, permissions, organization) are auto-discovered.

Default roles

Every new organization gets three scoped roles (mirroring better-auth):

Role Abilities
owner organization.update/delete, member.create/update/delete, invitation.create/cancel
admin organization.update, member.*, invitation.* — but not organization.delete
member organization.read (read only)

Customize them in config/auth-kit-organization.php. The permissions plugin's statement must declare the resources/actions these roles reference.

Usage

Active organization (session)

Endpoints

Method URI Body
POST /auth-kit/organization/create { name, subject_type, subject_id, slug? }
POST /auth-kit/organization/invite { organization_id, email, role }
POST /auth-kit/organization/accept-invitation { token, subject_type, subject_id }
POST /auth-kit/organization/set-active { organization_id }
POST /auth-kit/organization/check { organization_id, subject_type, subject_id, ability }

Scope isolation

Because authorization is scoped, a role in one organization grants nothing in another:

This is enforced by the permissions plugin's polymorphic scope and covered by tests.

Teams (v0.2)

Teams are nested inside organizations and act as an independent team authorization scope — the same mechanism as organizations, with no change to auth-kit-permissions (see ADR 004).

Default team roles (configurable under team_roles):

Role Abilities
lead team.update, team-member.create/update/delete
member team.read (read only)

Rules (enforced + tested):

Team endpoints

Method URI Body
POST /auth-kit/organization/teams/create { organization_id, name, subject_type, subject_id, slug? }
POST /auth-kit/organization/teams/add-member { team_id, subject_type, subject_id, role }
POST /auth-kit/organization/teams/check { team_id, subject_type, subject_id, ability }

Developing against local packages

License

MIT © Gusman Widodo. See LICENSE.


All versions of auth-kit-organization with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
gusmanwidodo/auth-kit Version ^0.1
gusmanwidodo/auth-kit-permissions Version ^0.1
illuminate/contracts Version ^12.0
illuminate/database Version ^12.0
illuminate/support Version ^12.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package gusmanwidodo/auth-kit-organization contains the following files

Loading the files please wait ...