PHP 클래스 Silber\Bouncer\Bouncer

파일 보기 프로젝트 열기: JosephSilber/bouncer 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$clipboard Silber\Bouncer\Contracts\Clipboard The bouncer clipboard instance.
$gate Illuminate\Contracts\Auth\Access\Gate | null The access gate instance.

공개 메소드들

메소드 설명
__construct ( Silber\Bouncer\Contracts\Clipboard $clipboard ) Constructor.
ability ( array $attributes = [] ) : Ability Get an instance of the ability model.
allow ( Model | string $authority ) : GivesAbility Start a chain, to allow the given authority an ability.
allows ( string $ability, array | mixed $arguments = [] ) : boolean Determine if the given ability should be granted for the current authority.
assign ( Role | string $role ) : AssignsRole Start a chain, to assign the given role to a model.
cache ( Illuminate\Contracts\Cache\Store $cache = null ) Use the given cache instance.
create ( Model $user = null ) : static Create a new Bouncer instance.
define ( string $ability, callable | string $callback ) Define a new ability using a callback.
denies ( string $ability, array | mixed $arguments = [] ) : boolean Determine if the given ability should be denied for the current authority.
disallow ( Model | string $authority ) : RemovesAbility Start a chain, to disallow the given authority an ability.
dontCache ( ) Fully disable all query caching.
forbid ( Model | string $authority ) : GivesAbility Start a chain, to forbid the given authority an ability.
getGate ( $throw = false ) : Illuminate\Contracts\Auth\Access\Gate | null Get the gate instance.
is ( Model $authority ) : ChecksRole Start a chain, to check if the given authority has a certain role.
make ( Model $user = null ) : Silber\Bouncer\Factory. Create a bouncer factory instance.
ownedVia ( string | Closure $model, string | Closure | null $attribute = null ) : void Register an attribute/callback to determine if a model is owned by a given authority.
refresh ( Model $authority = null ) Clear the cache.
refreshFor ( Model $authority ) Clear the cache for the given authority.
retract ( Role | string $role ) : RemovesRole Start a chain, to retract the given role from a model.
role ( array $attributes = [] ) : Role Get an instance of the role model.
seed ( ) Run the registered seeders.
seeder ( Closure | string $seeder ) Register a seeder callback.
setGate ( Illuminate\Contracts\Auth\Access\Gate $gate ) Set the access gate instance.
tables ( array $map ) : void Set custom table names.
unforbid ( Model | string $authority ) : RemovesAbility Start a chain, to unforbid the given authority an ability.
useAbilityModel ( string $model ) Set the model to be used for abilities.
useRoleModel ( string $model ) Set the model to be used for roles.
useUserModel ( string $model ) Set the model to be used for users.
usesCachedClipboard ( ) : boolean Determine whether the clipboard used is a cached clipboard.

보호된 메소드들

메소드 설명
resolve ( string $abstract, array $parameters = [] ) : mixed Resolve the given type from the container.

메소드 상세

__construct() 공개 메소드

Constructor.
public __construct ( Silber\Bouncer\Contracts\Clipboard $clipboard )
$clipboard Silber\Bouncer\Contracts\Clipboard

ability() 공개 메소드

Get an instance of the ability model.
public ability ( array $attributes = [] ) : Ability
$attributes array
리턴 Silber\Bouncer\Database\Ability

allow() 공개 메소드

Start a chain, to allow the given authority an ability.
public allow ( Model | string $authority ) : GivesAbility
$authority Illuminate\Database\Eloquent\Model | string
리턴 Silber\Bouncer\Conductors\GivesAbility

allows() 공개 메소드

Determine if the given ability should be granted for the current authority.
public allows ( string $ability, array | mixed $arguments = [] ) : boolean
$ability string
$arguments array | mixed
리턴 boolean

assign() 공개 메소드

Start a chain, to assign the given role to a model.
public assign ( Role | string $role ) : AssignsRole
$role Silber\Bouncer\Database\Role | string
리턴 Silber\Bouncer\Conductors\AssignsRole

cache() 공개 메소드

Use the given cache instance.
public cache ( Illuminate\Contracts\Cache\Store $cache = null )
$cache Illuminate\Contracts\Cache\Store

create() 공개 정적인 메소드

Create a new Bouncer instance.
public static create ( Model $user = null ) : static
$user Illuminate\Database\Eloquent\Model
리턴 static

define() 공개 메소드

Define a new ability using a callback.
public define ( string $ability, callable | string $callback )
$ability string
$callback callable | string

denies() 공개 메소드

Determine if the given ability should be denied for the current authority.
public denies ( string $ability, array | mixed $arguments = [] ) : boolean
$ability string
$arguments array | mixed
리턴 boolean

disallow() 공개 메소드

Start a chain, to disallow the given authority an ability.
public disallow ( Model | string $authority ) : RemovesAbility
$authority Illuminate\Database\Eloquent\Model | string
리턴 Silber\Bouncer\Conductors\RemovesAbility

dontCache() 공개 메소드

Fully disable all query caching.
public dontCache ( )

forbid() 공개 메소드

Start a chain, to forbid the given authority an ability.
public forbid ( Model | string $authority ) : GivesAbility
$authority Illuminate\Database\Eloquent\Model | string
리턴 Silber\Bouncer\Conductors\GivesAbility

getGate() 공개 메소드

Get the gate instance.
public getGate ( $throw = false ) : Illuminate\Contracts\Auth\Access\Gate | null
리턴 Illuminate\Contracts\Auth\Access\Gate | null

is() 공개 메소드

Start a chain, to check if the given authority has a certain role.
public is ( Model $authority ) : ChecksRole
$authority Illuminate\Database\Eloquent\Model
리턴 Silber\Bouncer\Conductors\ChecksRole

make() 공개 정적인 메소드

Create a bouncer factory instance.
public static make ( Model $user = null ) : Silber\Bouncer\Factory.
$user Illuminate\Database\Eloquent\Model
리턴 Silber\Bouncer\Factory.

ownedVia() 공개 메소드

Register an attribute/callback to determine if a model is owned by a given authority.
public ownedVia ( string | Closure $model, string | Closure | null $attribute = null ) : void
$model string | Closure
$attribute string | Closure | null
리턴 void

refresh() 공개 메소드

Clear the cache.
public refresh ( Model $authority = null )
$authority Illuminate\Database\Eloquent\Model

refreshFor() 공개 메소드

Clear the cache for the given authority.
public refreshFor ( Model $authority )
$authority Illuminate\Database\Eloquent\Model

resolve() 보호된 메소드

Resolve the given type from the container.
protected resolve ( string $abstract, array $parameters = [] ) : mixed
$abstract string
$parameters array
리턴 mixed

retract() 공개 메소드

Start a chain, to retract the given role from a model.
public retract ( Role | string $role ) : RemovesRole
$role Silber\Bouncer\Database\Role | string
리턴 Silber\Bouncer\Conductors\RemovesRole

role() 공개 메소드

Get an instance of the role model.
public role ( array $attributes = [] ) : Role
$attributes array
리턴 Silber\Bouncer\Database\Role

seed() 공개 메소드

Run the registered seeders.
public seed ( )

seeder() 공개 메소드

Register a seeder callback.
public seeder ( Closure | string $seeder )
$seeder Closure | string

setGate() 공개 메소드

Set the access gate instance.
public setGate ( Illuminate\Contracts\Auth\Access\Gate $gate )
$gate Illuminate\Contracts\Auth\Access\Gate

tables() 공개 정적인 메소드

Set custom table names.
public static tables ( array $map ) : void
$map array
리턴 void

unforbid() 공개 메소드

Start a chain, to unforbid the given authority an ability.
public unforbid ( Model | string $authority ) : RemovesAbility
$authority Illuminate\Database\Eloquent\Model | string
리턴 Silber\Bouncer\Conductors\RemovesAbility

useAbilityModel() 공개 정적인 메소드

Set the model to be used for abilities.
public static useAbilityModel ( string $model )
$model string

useRoleModel() 공개 정적인 메소드

Set the model to be used for roles.
public static useRoleModel ( string $model )
$model string

useUserModel() 공개 정적인 메소드

Set the model to be used for users.
public static useUserModel ( string $model )
$model string

usesCachedClipboard() 공개 메소드

Determine whether the clipboard used is a cached clipboard.
public usesCachedClipboard ( ) : boolean
리턴 boolean

프로퍼티 상세

$clipboard 보호되어 있는 프로퍼티

The bouncer clipboard instance.
protected Clipboard,Silber\Bouncer\Contracts $clipboard
리턴 Silber\Bouncer\Contracts\Clipboard

$gate 보호되어 있는 프로퍼티

The access gate instance.
protected Gate,Illuminate\Contracts\Auth\Access|null $gate
리턴 Illuminate\Contracts\Auth\Access\Gate | null