Class

ActionAuthorization

Package: PHPBoost\Member\authorization Copyright: © 2005-2019 PHPBoost License: GNU/GPL-3.0 Author: Benoit SAUTEL ben.popeye@phpboost.com Version: PHPBoost 5.2 - last update: 2018 11 05 Since: PHPBoost 3.0 - 2010 03 01 Contributor: Julien BRISWALTER j1.seth@phpboost.com Located at: phpboost/member/authorization/ActionAuthorization.class.php

This class represents the authorizations for an action. It's associated to a label, a description, the bit in which flags are saved, and obviously the authorization array which is encapsulated in the RolesAuthorizations class. The bit which is used to store the authorization is 2^n where n is the number of the place you want to use. It's recommanded to begin with 1 (2^0 = 1) then 2 (2^1 = 2) then 4 (2^2 = 4) etc...

Methods summary
public
# __construct( string $label, integer $bit, string $description = '', RolesAuthorizations $roles = null, mixed[] $disabled_ranks = array() )

Builds an ActionAuthorization from its properties

public string
# get_label( )

Returns the label

public
# set_label( string $label )

Sets the label

public integer
# get_bit( )

Returns the bit which is used to store the authorization flags.

public
# set_bit( integer $bit )

Sets the bit corresponding to the autorization flags.

public string
# get_description( )

Returns the action description

public
# set_description( string $description )

Sets the description associated to the action

public RolesAuthorizations
# get_roles_auths( )

Returns the roles authorizations associated to this action

public
# set_roles_auths( RolesAuthorizations $roles )

Sets the roles authorizations

public mixed[]
# get_disabled_ranks( )

Returns the disabled ranks in select associated to this action

public
# set_disabled_ranks( array $disabled_ranks )

Sets the disabled ranks in select

public mixed[]
# build_auth_array( )

Builds the array at the legacy format containing only the action's authorizations.

public
# build_from_auth_array( array $auth_array )

Sets authorizations from a array at the legacy format.

Annonces