Class Permission
Represents a permission assigned to a group.
- Object
-
ViewableData
implements
IteratorAggregate
-
DataObject
implements
DataObjectInterface,
i18nEntityProvider
-
Permission
Methods summary
public static
integer|boolean
|
|
public static
|
#
flush_permission_cache( )
Flush the permission cache, for example if you have edited group membership or a permission record. |
public static
integer|boolean
|
#
checkMember( integer|
Check that the given member has the given permission. |
public static
array();
|
#
permissions_for_member( mixed $memberID )
Get all the 'any' permission codes available to the given member. |
public static
array
|
|
public static
|
|
public static
|
|
public static
|
|
public static
|
#
get_groups_by_permission( mixed $codes )
Return all of the groups that have one of the given permission codes |
public static
array
|
#
get_codes( boolean $grouped = true )
Get a list of all available permission codes, both defined through the |
public static
|
|
public static
|
|
public static
array
|
|
public static
Label
|
#
get_label_for_permission( mixed $perm )
Look up the human-readable title for the permission as defined by
|
protected static
|
#
traverse_declared_permissions( aeeay $declared, mixed & $list )
Recursively traverse the nested list of declared permissions and create a linear list. |
public
|
#
onBeforeWrite( )
Event handler called before writing to the database. You can overload this to clean up or otherwise process data before writing it to the database. Don't forget to call parent::onBeforeWrite(), though! |
Methods inherited from DataObject
Aggregate(),
RelationshipAggregate(),
__construct(),
baseTable(),
belongs_to(),
buildDataObjectSet(),
buildSQL(),
can(),
canCreate(),
canDelete(),
canEdit(),
canView(),
castedUpdate(),
composite_fields(),
context_obj(),
customDatabaseFields(),
custom_database_fields(),
data(),
databaseFields(),
databaseIndexes(),
database_extensions(),
database_fields(),
db(),
dbObject(),
debug(),
defaultSearchFilters(),
defineMethods(),
delete(),
delete_by_id(),
destroy(),
disableCMSFieldsExtensions(),
disable_subclass_access(),
duplicate(),
enableCMSFieldsExtensions(),
enable_subclass_access(),
exists(),
extendedSQL(),
fieldLabel(),
fieldLabels(),
flushCache(),
flush_and_destroy_cache(),
forceChange(),
get(),
getAllFields(),
getCMSActions(),
getCMSFields(),
getChangedFields(),
getClassAncestry(),
getComponent(),
getComponents(),
getComponentsQuery(),
getDefaultSearchContext(),
getField(),
getFrontEndFields(),
getManyManyComponents(),
getManyManyComponentsQuery(),
getManyManyFilter(),
getManyManyJoin(),
getRemoteJoinField(),
getReverseAssociation(),
getTitle(),
get_by_id(),
get_one(),
get_validation_enabled(),
hasDatabaseField(),
hasField(),
hasOwnTableDatabaseField(),
hasValue(),
has_many(),
has_one(),
has_own_table(),
i18n_plural_name(),
i18n_singular_name(),
inheritedDatabaseFields(),
instance_get(),
instance_get_one(),
isChanged(),
isEmpty(),
isInDB(),
is_composite_field(),
many_many(),
many_many_extraFields(),
merge(),
newClassInstance(),
onAfterDelete(),
onAfterWrite(),
onBeforeDelete(),
plural_name(),
populateDefaults(),
provideI18nEntities(),
relObject(),
requireDefaultRecords(),
requireTable(),
reset(),
scaffoldFormFields(),
scaffoldSearchFields(),
searchableFields(),
setCastedField(),
setClassName(),
setComponent(),
setField(),
set_context_obj(),
set_validation_enabled(),
singular_name(),
summaryFields(),
toMap(),
update(),
validate(),
write(),
writeComponents(),
writeWithoutVersion()
Methods inherited from ViewableData
ATT_val(),
BaseHref(),
CSSClasses(),
ColumnBreak(),
ColumnCalc(),
ColumnNumber(),
ColumnPad(),
ColumnPos(),
CurrentMember(),
CurrentPage(),
Debug(),
Even(),
EvenOdd(),
First(),
FirstLast(),
HasPerm(),
IsAjax(),
JS_val(),
Last(),
Me(),
Middle(),
MiddleString(),
Modulus(),
MultipleOf(),
Odd(),
Pos(),
RAW_val(),
SQL_val(),
ThemeDir(),
ThemeName(),
Top(),
TotalItems(),
XML_val(),
__get(),
__isset(),
__set(),
buildCastingCache(),
cachedCall(),
castingClass(),
castingHelper(),
castingHelperPair(),
castingObjectCreator(),
castingObjectCreatorPair(),
customise(),
escapeTypeForField(),
getIterator(),
getSecurityID(),
getXMLValues(),
i18nLocale(),
iteratorProperties(),
obj(),
renderWith(),
setCustomisedObj()
Methods inherited from Object
__call(),
__toString(),
__wakeup(),
addMethodsFrom(),
addStaticVars(),
addWrapperMethod(),
add_extension(),
add_static_var(),
allMethodNames(),
cacheToFile(),
cacheToFileWithArgs(),
clearCache(),
combined_static(),
create(),
createMethod(),
create_from_string(),
extInstance(),
extend(),
getCustomClass(),
getExtensionInstance(),
getExtensionInstances(),
get_extensions(),
get_static(),
hasExtension(),
hasMethod(),
has_extension(),
invokeWithExtensions(),
is_a(),
loadCache(),
parentClass(),
parse_class_spec(),
remove_extension(),
sanitiseCachename(),
saveCache(),
set_stat(),
set_static(),
set_uninherited(),
stat(),
strong_create(),
uninherited(),
uninherited_static(),
useCustomClass()
Magic methods summary
Constants summary
integer |
GRANT_PERMISSION
|
1 |
#
This is the value to use for the "Type" field if a permission should be granted. |
integer |
DENY_PERMISSION
|
-1 |
#
This is the value to use for the "Type" field if a permission should be denied. |
integer |
INHERIT_PERMISSION
|
0 |
#
This is the value to use for the "Type" field if a permission should be inherited. |
Properties summary
public static
array
|
$db |
#
Database field definitions. This is a map from field names to field type. The field type should be a class that extends . |
public static
array
|
$has_one |
#
One-to-zero relationship defintion. This is a map of component name to data
type. In order to turn this into a true one-to-one relationship you can add a
|
public static
array
|
$indexes |
#
If a field is in this array, then create a database index on that field. This is a map from fieldname to index type. See SS_Database->requireIndex() and custom subclasses for details on the array notation. |
public static
array
|
$defaults |
#
Inserts standard column-values when a DataObject is instanciated. Does not
insert default records |
public static
array
|
$has_many |
#
This defines a one-to-many relationship. It is a map of component name to the remote data class. |
public static
array
|
$many_many |
#
many-many relationship definitions. This is a map from component name to data type. |
public static
array
|
$belongs_many_many |
#
The inverse side of a many-many relationship. This is a map from component name to data type. |
public static
boolean
|
$declared_permissions |
#
Method to globally disable "strict" checking, which means a permission will be granted if the key does not exist at all. |
protected static
array
|
$declared_permissions_list |
#
Linear list of declared permissions in the system. |
public static
boolean
|
$strict_checking |
#
Boolean Method to globally disable "strict" checking, which means a permission will be granted if the key does not exist at all. |
public static
boolean
|
$implied_permissions |
#
If this setting is set, then permissions can imply other permissions |
public static
boolean
|
$admin_implies_all |
#
Set to false to prevent the 'ADMIN' permission from implying all permissions in the system |
Properties inherited from DataObject
$allowed_actions,
$ancestry,
$api_access,
$belongs_to,
$brokenOnDelete,
$brokenOnWrite,
$cache_get_one,
$cache_has_own_table,
$cache_has_own_table_field,
$casting,
$componentCache,
$components,
$create_table_options,
$default_records,
$default_sort,
$destroyed,
$field_labels,
$many_many_extraFields,
$original,
$plural_name,
$record,
$searchable_fields,
$singular_name,
$summary_fields
Properties inherited from ViewableData
$customisedObject,
$default_cast,
$failover,
$iteratorPos,
$iteratorTotalItems