throw new RepositoryException("Permission cannot be null");
// check if changing permission allowed
checkPermission(PermissionType.CHANGE_PERMISSION);
AccessControlList acl = new AccessControlList(getACL().getOwner(), getACL().getPermissionEntries());
acl.removePermissions(identity);
acl.addPermissions(identity, permission);
updatePermissions(acl);
setACL(acl);
}