[ Index ]

PHP Cross Reference of GlotPress

title

Body

[close]

/gp-includes/things/ -> permission.php (summary)

Things: GP_Permission class

File Size: 139 lines (4 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

GP_Permission:: (3 methods):
  normalize_fields()
  current_user_can()
  user_can()


Class: GP_Permission  - X-Ref

Core class used to implement the permissions.

normalize_fields( $args )   X-Ref
Normalizes an array with key-value pairs representing
a GP_Permission object.

since: 1.0.0
return: array Normalized arguments for a GP_Permission object.
param: array $args Arguments for a GP_Permission object.

current_user_can( $action, $object_type = null, $object_id = null, $extra = null )   X-Ref
Determines whether the current user can do $action on the instance of $object_type with id $object_id.

Example: GP::$permission->current_user_can( 'read', 'translation-set', 11 );

param: string $action
param: string $object_type
param: int    $object_id
param: mixed  $extra

user_can( $user, $action, $object_type = null, $object_id = null, $extra = null )   X-Ref
Determines whether the user can do $action on the instance of $object_type with id $object_id.

Example: GP::$permission->user_can( $user, 'read', 'translation-set', 11 );

param: int|object $user
param: string     $action
param: string     $object_type
param: int        $object_id
param: mixed      $extra



Generated: Wed Nov 20 01:01:59 2019 Cross-referenced by PHPXref 0.7.1