Download the PHP package bfg/permission without Composer
On this page you can find all versions of the php package bfg/permission. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download bfg/permission
More information about bfg/permission
Files in bfg/permission
Package permission
Short Description The ability to create and monitor the rules for the Laravel gates
License MIT
Informations about the package permission
Extension permission
Install
-
Install as dependency:
-
Set up for mode
Permission
trait: - Install resources and tables:
About the concept.
The ability to create and monitor the rules for the
Laravel gates
with
the distribution on the role and the ability to control it conveniently.
Also comes with a user role model and a list of ready-made roles,
such as: Root
, Administrator
, Moderator
, User
, Guest
.
Description
The package has a hierarchy of roles and can distribute access between
them, using the Laravel gates
system. The warehouse for the gate is simply "PHP" file with an array in
the "Storage" folder.
Where can I use it?
Always when you want to use the authorization control system "Laravel" through the gate, but do not want to cheat a whole bunch of rumbled rows with a gate or create a bunch of files with politicians if you need to control all your gates and disable or switch them between the roles of users.
Publish
Publish configs
Publish migrations
Commands
Commands for managing access and distribution of them between roles.
Permission list
In order to display a full list of rules for the gate.
But it happens so that the rules becomes too much and on this can be used by searching, specifying the search word immediately after the command, for example:
Output:
Allow or add permission
To add immediately with open access or open access to the rule, you must use this command.
If you create a rule as a resource:
You will be created 7 rules with the name you indicated, namely:
viewAny-message
, view-message
, create-message
, update-message
,
delete-message
, restore-message
, forceDelete-message
In order to manage access for a role or for a user, you can add the following parameter that calls for the user ID or role name:
Opens access to all communication resources for the guest.
Disallow or add permission
To immediately add with closed access or close access to the rule, you must use this command.
All the logic of the team is identical to the opening team.
Delete permission
To remove the rules of the gate from the general list.
You can delete one rule or immediately all its resources using the resource flag:
How to use?
All rules created by you automatically fall into the system of the gate
of "Laravel" and in this can be used as before you used the system
of the Laravel gates
.
Important! If you transmit as a parameter to the gate model that is recovered, the rules will check the field
user_id
andid
user-friendly gate. These fields are configured in the settingsuser_eq_field
andmodel_eq_field
. Or you can write a class verification rule by adding thegateCheck(string $rule, Model $user, Model $model)
method into it.
All versions of permission with dependencies
bfg/installer Version *
bfg/entity Version *
bfg/object Version *
bfg/repository Version *