ePages 6.17.17 - DE_EPAGES/Presentation/API/TLE/PermissionHandler.pm

Package DE_EPAGES::Presentation::API::TLE::PermissionHandler

Functions

CanAction
HASROLE
ISACTIONALLOWED

CanAction

Returns true if the given Action is available for that object, considering the inheritance chain of the object

Syntax
#CanAction(#Object, #ActionName )
Example
#IF(#CanAction( #Object, "MBO-ViewSettings")) ... #ENDIF
Input
#Object (object)
the object to check
#ActionName (string)
the name of the Action, e.g. "MBO-ViewSettings"
Return
#Result (boolean)
true if the Action exists for this Object

HASROLE

Determines, whether the user has a specific role for an object.

Syntax
#HASROLE(#RoleClass, #RoleName)
#HASROLE(#RoleClass, #RoleName, #Object)
#HASROLE(#RoleClass, #RoleName, #Object, #User)
Example
#IF( #HASROLE("Object", "View", #Shop.Object, #SESSION.User.Object) )
  ..
#ENDIF
Input
$Processor (object)
tle processor
#RoleClass (string)
class of the role
#RoleName (string)
name of the role
#Object (ref.object)
object to check for, default is object in current scope
(optional)
#User (ref.object)
user to check for this role, default is the current
user (optional)
Return
#Allowed (boolean)
true if role is allowed

ISACTIONALLOWED

Determines whether an action is allowed for the given object and user.

Syntax
#ISACTIONALLOWED(#ActionName)
#ISACTIONALLOWED(#ActionName, #Object)
#ISACTIONALLOWED(#ActionName, #Object, #User)
Example
#IF( #ISACTIONALLOWED("View", #Shop.Object, #SESSION.User.Object) )
  ...
#ENDIF
Input
$Processor (object)
tle processor
#ActionName (string)
name of an action
#Object (ref.object)
object of the action, default is object in current scope
(optional)
#User (ref.object)
user to check for this permission, default is the current
user (optional)
Return
#Allowed (boolean)
true if action is allowed