baserCMS クラスリファレンス

PermissionsAdminService extends PermissionsService
in package
implements PermissionsAdminServiceInterface Uses BcContainerTrait

PermissionsAdminService

Table of Contents

Interfaces

PermissionsAdminServiceInterface
PermissionsAdminServiceInterface

Properties

$adminUrlPrefix  : string
$Permissions  : Table
Permissions Table
$Permissions  : PermissionsTable
$defaultAllows  : array<string|int, mixed>
$defaultDenies  : array<string|int, mixed>

Methods

__construct()  : mixed
PermissionsService constructor.
addCheck()  : void
権限チェック対象を追加する
batch()  : bool
一括処理
changeSort()  : bool
優先度を変更する
check()  : bool
URLとメソッドに対してのアクセス権限チェックを行う
convertRegexUrl()  : string
URLを正規表現用の文字列に変換する
copy()  : EntityInterface|false
複製する
create()  : EntityInterface
パーミッション登録
delete()  : bool
パーミッション情報を削除する
get()  : EntityInterface
パーミッションを取得する
getAuthList()  : array<string|int, mixed>
権限リストを取得
getControlSource()  : array<string|int, mixed>
コントロールソースを取得する
getIndex()  : Query
パーミッション管理の一覧用のデータを取得
getList()  : array<string|int, mixed>
リストデータを取得 対応しない
getMethodList()  : array<string|int, mixed>
許可・拒否を指定するメソッドのリストを取得
getNamesById()  : array<string|int, mixed>
IDを指定して名前リストを取得する
getNew()  : Permission
パーミッションの新規データ用の初期値を含んだエンティティを取得する
getService()  : array<string|int, mixed>|mixed|object
Get Service
getViewVarsForAdd()  : array<string|int, mixed>
アクセスルール新規登録画面用の View 変数を取得する
getViewVarsForEdit()  : array<string|int, mixed>
アクセスルール編集画面用の View 変数を取得する
getViewVarsForIndex()  : array<string|int, mixed>
アクセスルール一覧用の View 変数を取得する
hasService()  : bool
Has Service
isAuthorized()  : bool
URLとメソッドについて許可されているか確認
publish()  : bool
有効状態にする
unpublish()  : bool
無効状態にする
update()  : EntityInterface
パーミッション情報を更新する
autoFillRecord()  : array<string|int, mixed>
レコード作成に必要なデータを代入する
checkDefaultAllow()  : bool
標準アクセス許可リストからURLを検証
checkDefaultDeny()  : bool
標準アクセス拒否リストからURLを検証
checkGroup()  : bool
パーミッションリストを検証する
setDefaultAllow()  : void
標準アクセス許可リクエストを設定

Properties

Methods

__construct()

PermissionsService constructor.

public __construct() : mixed
Tags
checked
noTodo
unitTest

addCheck()

権限チェック対象を追加する

public addCheck(string $url, bool $auth) : void
Parameters
$url : string
$auth : bool
Tags
checked
noTodo
unitTest

batch()

一括処理

public batch(mixed $method, array<string|int, mixed> $ids) : bool
Parameters
$method : mixed
$ids : array<string|int, mixed>
Tags
checked
noTodo
unitTest
Return values
bool

changeSort()

優先度を変更する

public changeSort(int $id, int $offset[, array<string|int, mixed> $conditions = [] ]) : bool
Parameters
$id : int
$offset : int
$conditions : array<string|int, mixed> = []
Tags
checked
noTodo
unitTest
Return values
bool

check()

URLとメソッドに対してのアクセス権限チェックを行う

public check(string $url, array<string|int, mixed> $userGroupId[, string $method = 'GET' ]) : bool

ユーザーが複数のグループに所属する前提として、 各所属グループごとにURLとメソッドに対してのアクセス権限を確認し、 一つでもアクセス可であれば、対象URLとメソッドについてアクセス権限があるとみなす

Parameters
$url : string
$userGroupId : array<string|int, mixed>
$method : string = 'GET'
Tags
checked
unitTest
noTodo
Return values
bool

convertRegexUrl()

URLを正規表現用の文字列に変換する

public convertRegexUrl(string $url) : string
Parameters
$url : string
Tags
noTodo
unitTest
checked
Return values
string

copy()

複製する

public copy(int $permissionId) : EntityInterface|false
Parameters
$permissionId : int
Tags
checked
noTodo
unitTest
Return values
EntityInterface|false

create()

パーミッション登録

public create(array<string|int, mixed> $postData) : EntityInterface
Parameters
$postData : array<string|int, mixed>
Tags
throws
PersistenceFailedException
checked
noTodo
unitTest
Return values
EntityInterface

delete()

パーミッション情報を削除する

public delete(int $id) : bool
Parameters
$id : int
Tags
checked
noTodo
unitTest
Return values
bool

get()

パーミッションを取得する

public get(int $id) : EntityInterface
Parameters
$id : int
Tags
checked
noTodo
unitTest
Return values
EntityInterface

getAuthList()

権限リストを取得

public getAuthList() : array<string|int, mixed>
Tags
noTodo
unitTest
checked
Return values
array<string|int, mixed>

getControlSource()

コントロールソースを取得する

public getControlSource(string $field[, array<string|int, mixed> $options = [] ]) : array<string|int, mixed>
Parameters
$field : string
$options : array<string|int, mixed> = []
Tags
checked
noTodo
Return values
array<string|int, mixed>

getIndex()

パーミッション管理の一覧用のデータを取得

public getIndex([array<string|int, mixed> $queryParams = [] ]) : Query
Parameters
$queryParams : array<string|int, mixed> = []
Tags
checked
noTodo
unitTest
Return values
Query

getList()

リストデータを取得 対応しない

public getList() : array<string|int, mixed>
Tags
checked
noTodo
unitTest
Return values
array<string|int, mixed>

getMethodList()

許可・拒否を指定するメソッドのリストを取得

public getMethodList() : array<string|int, mixed>
Tags
noTodo
unitTest
checked
Return values
array<string|int, mixed>

getNamesById()

IDを指定して名前リストを取得する

public getNamesById( $ids) : array<string|int, mixed>
Parameters
$ids :
Tags
checked
noTodo
unitTest
Return values
array<string|int, mixed>

getNew()

パーミッションの新規データ用の初期値を含んだエンティティを取得する

public getNew([int $userGroupId = null ][, int $permissionGroupId = null ]) : Permission
Parameters
$userGroupId : int = null
$permissionGroupId : int = null
Tags
checked
noTodo
unitTest
Return values
Permission

getService()

Get Service

public getService( $service) : array<string|int, mixed>|mixed|object
Parameters
$service :
Tags
checked
noTodo
unitTest
Return values
array<string|int, mixed>|mixed|object

getViewVarsForAdd()

アクセスルール新規登録画面用の View 変数を取得する

public getViewVarsForAdd(int $userGroupId, EntityInterface $entity) : array<string|int, mixed>
Parameters
$userGroupId : int
$entity : EntityInterface
Tags
checked
noTodo
Return values
array<string|int, mixed>

getViewVarsForEdit()

アクセスルール編集画面用の View 変数を取得する

public getViewVarsForEdit(int $userGroupId, EntityInterface $entity) : array<string|int, mixed>
Parameters
$userGroupId : int
$entity : EntityInterface
Tags
checked
noTodo
Return values
array<string|int, mixed>

getViewVarsForIndex()

アクセスルール一覧用の View 変数を取得する

public getViewVarsForIndex(ServerRequest $request, int $userGroupId) : array<string|int, mixed>
Parameters
$request : ServerRequest
$userGroupId : int
Tags
checked
noTodo
Return values
array<string|int, mixed>

hasService()

Has Service

public hasService( $service) : bool
Parameters
$service :
Tags
checked
noTodo
unitTest
Return values
bool

isAuthorized()

URLとメソッドについて許可されているか確認

public isAuthorized(int $permissionType, string $url, string $method, array<string|int, mixed> $groupPermission) : bool
Parameters
$permissionType : int
  • 1: ホワイトリスト(全部拒否して一部許可を設定)
  • 2: ブラックリスト(全部許可して一部拒否を設定)
$url : string
$method : string
$groupPermission : array<string|int, mixed>
Tags
checked
noTodo
unitTest
Return values
bool

publish()

有効状態にする

public publish(int $id) : bool
Parameters
$id : int
Tags
checked
noTodo
unitTest
Return values
bool

unpublish()

無効状態にする

public unpublish(int $id) : bool
Parameters
$id : int
Tags
checked
noTodo
unitTest
Return values
bool

update()

パーミッション情報を更新する

public update(EntityInterface $target, array<string|int, mixed> $data) : EntityInterface
Parameters
$target : EntityInterface
$data : array<string|int, mixed>
Tags
throws
PersistenceFailedException
checked
noTodo
unitTest
Return values
EntityInterface

autoFillRecord()

レコード作成に必要なデータを代入する

protected autoFillRecord([array<string|int, mixed> $data = [] ]) : array<string|int, mixed>
Parameters
$data : array<string|int, mixed> = []
Tags
noTodo
unitTest
checked
Return values
array<string|int, mixed>

$data

checkDefaultAllow()

標準アクセス許可リストからURLを検証

private checkDefaultAllow(string $url) : bool
Parameters
$url : string
Tags
checked
unitTest
noTodo
Return values
bool

checkDefaultDeny()

標準アクセス拒否リストからURLを検証

private checkDefaultDeny(string $url) : bool
Parameters
$url : string
Tags
checked
unitTest
noTodo
Return values
bool

checkGroup()

パーミッションリストを検証する

private checkGroup(string $url, array<string|int, mixed> $groupPermission, UserGroup|EntityInterface|null $userGroup[, string $method = 'GET' ]) : bool
Parameters
$url : string
$groupPermission : array<string|int, mixed>
$userGroup : UserGroup|EntityInterface|null
$method : string = 'GET'
Tags
checked
unitTest
noTodo
Return values
bool

setDefaultAllow()

標準アクセス許可リクエストを設定

private setDefaultAllow() : void
Tags
checked
noTodo
unitTest

        
On this page

Search results