/** * {@inheritDoc} */ public void saveMeetings(List<SignupMeeting> signupMeetings, String userId) throws PermissionException { if (signupMeetings ==null || signupMeetings.isEmpty()) return; if (isAllowedToCreate(userId, signupMeetings.get(0))) { signupMeetingDao.saveMeetings(signupMeetings); } else{ throw new PermissionException(userId, "signup.create", "signup tool"); } }
/** * {@inheritDoc} */ public Long saveMeeting(SignupMeeting signupMeeting, String userId) throws PermissionException { if (isAllowedToCreate(userId, signupMeeting)) { return signupMeetingDao.saveMeeting(signupMeeting); } throw new PermissionException(userId, "signup.create", "signup tool"); }
/** * 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 user does not have access */ protected void unlock(String lock, String resource) throws PermissionException { if (!unlockCheck(lock, resource)) { throw new PermissionException(sessionManager.getCurrentSessionUserId(), lock, resource); } }
/** * 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 user does not have access */ protected void unlock(String lock, String resource) throws PermissionException { if (!unlockCheck(lock, resource)) { throw new PermissionException(SessionManager.getCurrentSessionUserId(), lock, resource); } } // unlock
protected void checkPermission(String function, String context) throws PermissionException { if (!SecurityService.unlock(function, SiteService.siteReference(context))) { String user = SessionManager.getCurrentSessionUserId(); throw new PermissionException(user, function, context); } }
/** * 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 user does not have access */ protected void unlock(String lock, String resource) throws PermissionException { if (!unlockCheck(lock, resource)) { throw new PermissionException(m_sessionManager.getCurrentSessionUserId(), eventId(lock), resource); } } // unlock
/** * Throws a PermissionException if the resource with the given Id is explicitly locked * * @param id * @throws PermissionException */ protected void checkExplicitLock(String id) throws PermissionException { String uuid = this.getUuid(id); if (uuid != null && this.isLocked(uuid)) { // TODO: WebDAV locks need to be more sophisticated than this throw new PermissionException(sessionManager.getCurrentSessionUserId(), "remove", id); } }
/** * 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 user does not have access */ protected void unlock(String lock, String resource) throws PermissionException { if (!unlockCheck(lock, resource)) { throw new PermissionException(m_sessionManager.getCurrentSessionUserId(), eventId(lock), resource); } } // unlock
/** * 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 user does not have access */ protected void unlock(String lock, String resource) throws PermissionException { if (!unlockCheck(lock, resource)) { throw new PermissionException(sessionManager().getCurrentSessionUserId(), lock, resource); } } // unlock
/** * 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 user does not have access */ protected void unlock(String lock, String resource) throws PermissionException { if (!unlockCheck(lock, resource)) { throw new PermissionException(sessionManager().getCurrentSessionUserId(), lock, resource); } }
/** * 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 user does not have access */ protected void unlock(String lock, String resource) throws PermissionException { if (!unlockCheck(lock, resource)) { throw new PermissionException(m_sessionManager.getCurrentSessionUserId(), eventId(lock), resource); } } // unlock
/** * 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 user does not have access */ protected void unlock(String lock, String resource) throws PermissionException { if (!unlockCheck(lock, resource)) { throw new PermissionException(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(); }
/** * Check security permission. * * @param lock1 * The lock id string. * @param lock2 * The lock id string. * @param resource * The resource reference string, or null if no resource is involved. * @exception PermissionException * Thrown if the user does not have access to either. */ protected void unlock2(String lock1, String lock2, String resource) throws PermissionException { if (!unlockCheck2(lock1, lock2, resource)) { throw new PermissionException(sessionManager().getCurrentSessionUserId(), lock1 + "/" + lock2, resource); } }
/** * Check security permission. * * @param lock1 * The lock id string. * @param lock2 * The lock id string. * @param resource * The resource reference string, or null if no resource is involved. * @exception PermissionException * Thrown if the user does not have access to either. */ protected void unlock2(String lock1, String lock2, String resource) throws PermissionException { if (!unlockCheck2(lock1, lock2, resource)) { throw new PermissionException(m_sessionManager.getCurrentSessionUserId(), eventId(lock1) + "|" + eventId(lock2), resource); } } // unlock2
/** * {@inheritDoc} */ public ChatMessage createNewMessage(ChatChannel channel, String owner) throws PermissionException { if (channel == null) { throw new IllegalArgumentException("Must specify a channel"); } // We don't support posting by anonymous users if (owner == null) { throw new PermissionException(null, ChatFunctions.CHAT_FUNCTION_NEW, channel.getContext()); } checkPermission(ChatFunctions.CHAT_FUNCTION_NEW, channel.getContext()); ChatMessage message = new ChatMessage(); message.setChatChannel(channel); message.setOwner(owner); message.setMessageDate(new Date()); return message; }
/** * Check security permission. * * @param lock1 * The lock id string. * @param lock2 * The lock id string. * @param resource * The resource reference string, or null if no resource is involved. * @exception PermissionException * Thrown if the user does not have access to either. */ protected void unlock2(String lock1, String lock2, String resource) throws PermissionException { if (!unlockCheck2(lock1, lock2, resource)) { throw new PermissionException(m_sessionManager.getCurrentSessionUserId(), eventId(lock1) + "|" + eventId(lock2), resource); } } // unlock2
/** * @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(); } }
/** * Check security permission. * * @param lock1 * The lock id string. * @param lock2 * The lock id string. * @param lock3 * The lock id string. * @param resource * The resource reference string, or null if no resource is involved. * @exception PermissionException * Thrown if the user does not have access to either. */ protected void unlock3(String lock1, String lock2, String lock3, String resource) throws PermissionException { if (!unlockCheck3(lock1, lock2, lock3, resource)) { throw new PermissionException(m_sessionManager.getCurrentSessionUserId(), eventId(lock1) + "|" + eventId(lock2) + "|" + eventId(lock3), resource); } } // unlock3
/** * @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()); } }