/** * Check security permission. * * @param lock * The lock id string. * @param resource * The resource reference string, or null if no resource is involved. * @exception PermissionException * Thrown if the azGroup does not have access */ protected void unlock(String lock, String resource) throws AuthzPermissionException { if (!unlockCheck(lock, resource)) { throw new AuthzPermissionException(sessionManager().getCurrentSessionUserId(), lock, resource); } }
/** * @inheritDoc * @see org.sakaiproject.content.api.GroupAwareEdit#clearRoleAccess() */ public void clearRoleAccess() throws PermissionException { Set<String> roles = getRoleViews(this.m_id); for (String role : roles) { try { setRoleView(this.m_id, role, false); } catch (AuthzPermissionException e) { throw new PermissionException(e.getUser(), e.getFunction(), e.getResource()); } } if (roles.size() > 0) { this.m_accessUpdated = true; } this.m_access = AccessMode.INHERITED; this.m_groups.clear(); }
M_log.warn(" removeAssignment: removing realm for assignment reference=" + assignment.getReference() + " : " + e.getMessage());
} catch (AuthzPermissionException e) { e.printStackTrace();
M_log.warn(" removeSubmission: removing realm for : " + submission.getReference() + " : " + e.getMessage());
/** * @inheritDoc * @see org.sakaiproject.content.api.GroupAwareEdit#removeRoleAccess(String) */ public void removeRoleAccess(String roleId) throws InconsistentException, PermissionException { if (roleId == null || roleId.isEmpty()) { throw new InconsistentException("BasicGroupAwareEdit#removeRoleAccess - Must specify a role to remove for content " + this.getReference()); } if (isRoleView(this.m_id, roleId)) { try { setRoleView(this.m_id, roleId, false); } catch (AuthzPermissionException e) { throw new PermissionException(e.getUser(), e.getFunction(), e.getResource()); } this.m_accessUpdated = true; this.m_access = AccessMode.INHERITED; this.m_groups.clear(); } }
throw new AuthzPermissionException(null, SECURE_UPDATE_OWN_AUTHZ_GROUP, authzGroupId); if (maintainers.size() <= 1) throw new AuthzPermissionException(user, SECURE_UPDATE_OWN_AUTHZ_GROUP, authzGroupId); throw new AuthzPermissionException(user, SECURE_UPDATE_OWN_AUTHZ_GROUP, authzGroupId);
M_log.warn(" removeAssignment: removing realm for assignment reference=" + assignment.getReference() + " : " + e.getMessage());
/** * @inheritDoc */ public void unjoin(String id) throws IdUnusedException, PermissionException { try { authzGroupService().unjoinGroup(siteReference(id)); } catch (GroupNotDefinedException e) { throw new IdUnusedException(e.getId()); } catch (AuthzPermissionException e) { throw new PermissionException(e.getUser(), e.getFunction(), e.getResource()); } }
throw new AuthzPermissionException(null, SECURE_UPDATE_OWN_AUTHZ_GROUP, authzGroupId); throw new AuthzPermissionException(user, SECURE_UPDATE_OWN_AUTHZ_GROUP, authzGroupId);
/** * @inheritDoc * @see org.sakaiproject.content.api.GroupAwareEdit#addRoleAccess(String) */ public void addRoleAccess(String roleId) throws InconsistentException, PermissionException { if (roleId == null || roleId.isEmpty()) { throw new InconsistentException("BasicGroupAwareEdit#addRoleAccess - Must specify a role to remove for content " + this.getReference()); } if (!this.getInheritedGroups().isEmpty()) { throw new InconsistentException(String.format("BasicGroupAwareEdit#addRoleAccess: could not assign role %s because content %s inherits group access.", roleId, this.getReference())); } if (getInheritedRoleAccessIds().contains(roleId)) { throw new InconsistentException(String.format("BasicGroupAwareEdit#addRoleAccess: could not assign role %s because content %s inherits role access.", roleId, this.getReference())); } if (!(isRoleView(this.m_id, roleId))) { try { setRoleView(this.m_id, roleId, true); } catch (AuthzPermissionException e) { throw new PermissionException(e.getUser(), e.getFunction(), e.getResource()); } this.m_accessUpdated = true; this.m_access = AccessMode.INHERITED; this.m_groups.clear(); } }
throw new PermissionException(e.getUser(), e.getFunction(), e.getResource());