237 lines
4.4 KiB
YAML
237 lines
4.4 KiB
YAML
name: Gate
|
|
class_comment: null
|
|
dependencies: []
|
|
properties: []
|
|
methods:
|
|
- name: has
|
|
visibility: public
|
|
parameters:
|
|
- name: ability
|
|
comment: '# * Determine if a given ability has been defined.
|
|
|
|
# *
|
|
|
|
# * @param string $ability
|
|
|
|
# * @return bool'
|
|
- name: define
|
|
visibility: public
|
|
parameters:
|
|
- name: ability
|
|
- name: callback
|
|
comment: '# * Define a new ability.
|
|
|
|
# *
|
|
|
|
# * @param string $ability
|
|
|
|
# * @param callable|string $callback
|
|
|
|
# * @return $this'
|
|
- name: resource
|
|
visibility: public
|
|
parameters:
|
|
- name: name
|
|
- name: class
|
|
- name: abilities
|
|
default: 'null'
|
|
comment: '# * Define abilities for a resource.
|
|
|
|
# *
|
|
|
|
# * @param string $name
|
|
|
|
# * @param string $class
|
|
|
|
# * @param array|null $abilities
|
|
|
|
# * @return $this'
|
|
- name: policy
|
|
visibility: public
|
|
parameters:
|
|
- name: class
|
|
- name: policy
|
|
comment: '# * Define a policy class for a given class type.
|
|
|
|
# *
|
|
|
|
# * @param string $class
|
|
|
|
# * @param string $policy
|
|
|
|
# * @return $this'
|
|
- name: before
|
|
visibility: public
|
|
parameters:
|
|
- name: callback
|
|
comment: '# * Register a callback to run before all Gate checks.
|
|
|
|
# *
|
|
|
|
# * @param callable $callback
|
|
|
|
# * @return $this'
|
|
- name: after
|
|
visibility: public
|
|
parameters:
|
|
- name: callback
|
|
comment: '# * Register a callback to run after all Gate checks.
|
|
|
|
# *
|
|
|
|
# * @param callable $callback
|
|
|
|
# * @return $this'
|
|
- name: allows
|
|
visibility: public
|
|
parameters:
|
|
- name: ability
|
|
- name: arguments
|
|
default: '[]'
|
|
comment: '# * Determine if all of the given abilities should be granted for the
|
|
current user.
|
|
|
|
# *
|
|
|
|
# * @param iterable|string $ability
|
|
|
|
# * @param array|mixed $arguments
|
|
|
|
# * @return bool'
|
|
- name: denies
|
|
visibility: public
|
|
parameters:
|
|
- name: ability
|
|
- name: arguments
|
|
default: '[]'
|
|
comment: '# * Determine if any of the given abilities should be denied for the current
|
|
user.
|
|
|
|
# *
|
|
|
|
# * @param iterable|string $ability
|
|
|
|
# * @param array|mixed $arguments
|
|
|
|
# * @return bool'
|
|
- name: check
|
|
visibility: public
|
|
parameters:
|
|
- name: abilities
|
|
- name: arguments
|
|
default: '[]'
|
|
comment: '# * Determine if all of the given abilities should be granted for the
|
|
current user.
|
|
|
|
# *
|
|
|
|
# * @param iterable|string $abilities
|
|
|
|
# * @param array|mixed $arguments
|
|
|
|
# * @return bool'
|
|
- name: any
|
|
visibility: public
|
|
parameters:
|
|
- name: abilities
|
|
- name: arguments
|
|
default: '[]'
|
|
comment: '# * Determine if any one of the given abilities should be granted for
|
|
the current user.
|
|
|
|
# *
|
|
|
|
# * @param iterable|string $abilities
|
|
|
|
# * @param array|mixed $arguments
|
|
|
|
# * @return bool'
|
|
- name: authorize
|
|
visibility: public
|
|
parameters:
|
|
- name: ability
|
|
- name: arguments
|
|
default: '[]'
|
|
comment: '# * Determine if the given ability should be granted for the current user.
|
|
|
|
# *
|
|
|
|
# * @param string $ability
|
|
|
|
# * @param array|mixed $arguments
|
|
|
|
# * @return \Illuminate\Auth\Access\Response
|
|
|
|
# *
|
|
|
|
# * @throws \Illuminate\Auth\Access\AuthorizationException'
|
|
- name: inspect
|
|
visibility: public
|
|
parameters:
|
|
- name: ability
|
|
- name: arguments
|
|
default: '[]'
|
|
comment: '# * Inspect the user for the given ability.
|
|
|
|
# *
|
|
|
|
# * @param string $ability
|
|
|
|
# * @param array|mixed $arguments
|
|
|
|
# * @return \Illuminate\Auth\Access\Response'
|
|
- name: raw
|
|
visibility: public
|
|
parameters:
|
|
- name: ability
|
|
- name: arguments
|
|
default: '[]'
|
|
comment: '# * Get the raw result from the authorization callback.
|
|
|
|
# *
|
|
|
|
# * @param string $ability
|
|
|
|
# * @param array|mixed $arguments
|
|
|
|
# * @return mixed
|
|
|
|
# *
|
|
|
|
# * @throws \Illuminate\Auth\Access\AuthorizationException'
|
|
- name: getPolicyFor
|
|
visibility: public
|
|
parameters:
|
|
- name: class
|
|
comment: '# * Get a policy instance for a given class.
|
|
|
|
# *
|
|
|
|
# * @param object|string $class
|
|
|
|
# * @return mixed
|
|
|
|
# *
|
|
|
|
# * @throws \InvalidArgumentException'
|
|
- name: forUser
|
|
visibility: public
|
|
parameters:
|
|
- name: user
|
|
comment: '# * Get a guard instance for the given user.
|
|
|
|
# *
|
|
|
|
# * @param \Illuminate\Contracts\Auth\Authenticatable|mixed $user
|
|
|
|
# * @return static'
|
|
- name: abilities
|
|
visibility: public
|
|
parameters: []
|
|
comment: '# * Get all of the defined abilities.
|
|
|
|
# *
|
|
|
|
# * @return array'
|
|
traits: []
|
|
interfaces: []
|