(Quick Reference)

addPermission

Purpose

Grant a permission on a domain object instance to a recipient.

Examples

aclUtilService.addPermission Report, 1124, 'user123', BasePermission.WRITE

aclUtilService.addPermission reportInstance, 'user123', BasePermission.WRITE

Description

addPermission has three signatures:

void addPermission(Class<?> domainClass, long id, recipient, Permission permission)

void addPermission(domainObject, recipient, Permission permission)

void addPermission(ObjectIdentity oid, recipient, Permission permission)

Parameters

  • domainClass - the domain class, used when specifying the class and id
  • id - the instance id, used when specifying the class and id
  • domainObject - the domain class instance, used when the instance is available
  • recipient - the grantee; can be a String (username or role name), or a Sid, or an Authentication
  • permission - the permission to grant