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

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

Functions

HASROLE
ISACTIONALLOWED

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