public boolean hasPrivilege(String functionName, String siteId) { return SecurityService.unlock(functionName, "/site/" + siteId); }
/** * Check security permission. * @param lock The lock id string. * @param reference The resource's 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 reference) throws PermissionException { if (!SecurityService.unlock(lock, reference)) { // needs to bring back: where is sessionService // throw new PermissionException(UsageSessionService.getSessionUserId(), lock, reference); } } // unlock
public boolean hasPrivilege(String functionName, String siteId) { return SecurityService.unlock(functionName, "/site/" + siteId); }
private boolean hasPermission(User user, String gradebookUid, String permission) { return SecurityService.unlock(user, permission, SiteService.siteReference(gradebookUid)); }
private boolean hasPermission(User user, String gradebookUid, String permission) { return SecurityService.unlock(user, permission, SiteService.siteReference(gradebookUid)); }
/** * {@inheritDoc} */ public boolean isMaintainer(String context) { return SecurityService.unlock(SiteService.SECURE_UPDATE_SITE, SiteService.siteReference(context)); }
private boolean hasPermission(String gradebookUid, String permission) { return SecurityService.unlock(permission, SiteService.siteReference(gradebookUid)); }
protected boolean can(String function, String context) { return SecurityService.unlock(function, SiteService.siteReference(context)); }
private boolean hasPermission(String gradebookUid, String permission) { return SecurityService.unlock(permission, SiteService.siteReference(gradebookUid)); }
public boolean hasPrivilege(String functionName) { String context = ToolManager.getCurrentPlacement().getContext(); boolean privilege = SecurityService.unlock(functionName, "/site/"+context); return privilege; }
public boolean hasPrivilege(String functionName) { String context = ToolManager.getCurrentPlacement().getContext(); boolean privilege = SecurityService.unlock(functionName, "/site/"+context); return privilege; }
/** * @param uid * @return */ private boolean isSiteMember(String uid) { if (LOG.isDebugEnabled()) { LOG.debug("isSiteMember(String" + uid + ")"); } try { return SecurityService.unlock(uid, SiteService.SITE_VISIT, SiteService.siteReference(getCurrentSiteId())); } catch (Exception e) { LOG.error("Exception:", e); } return false; }
/** * Check if the current user is allowed to do options for the current context (site based) * @return true if the user is allowed to modify the current context's options, false if not. */ protected boolean allowedToOptions() { Placement placement = ToolManager.getCurrentPlacement(); String context = null; if (placement != null) context = placement.getContext(); // TODO: stolen from site -ggolden if (SecurityService.unlock("site.upd", "/site/" + context)) { return true; } return false; }
/** * check permissions for addMessage() for the given user. * * @param user * The user. * @return true if the specified user is allowed to addMessage(...), false if not. */ public boolean allowAddMessage(User user) { if (!SecurityService.unlock(user, eventId(SECURE_ADD), getReference())) { return false; } return true; }
/** * Check if the current user is allowed to do options for the current context (site based) * @return true if the user is allowed to modify the current context's options, false if not. */ protected boolean allowedToOptions() { Placement placement = ToolManager.getCurrentPlacement(); String context = null; if (placement != null) context = placement.getContext(); // TODO: stolen from site -ggolden if (SecurityService.unlock("site.upd", "/site/" + context)) { return true; } return false; }
/** * @see org.sakaiproject.api.common.edu.person.SakaiPersonManager#delete(org.sakaiproject.api.common.edu.person.SakaiPerson) */ public void delete(final SakaiPerson sakaiPerson) { if (LOG.isDebugEnabled()) { LOG.debug("delete(SakaiPerson " + sakaiPerson + ")"); } if (sakaiPerson == null) throw new IllegalArgumentException("Illegal sakaiPerson argument passed!"); String ref = getReference(sakaiPerson); //only someone with the appropriate permissions can delete if(!SecurityService.unlock("user.del", ref)){ throw new SecurityException("You do not have permission to delete this sakaiPerson."); } LOG.debug("getHibernateTemplate().delete(sakaiPerson);"); getHibernateTemplate().delete(sakaiPerson); eventTrackingService.post(eventTrackingService.newEvent("profile.delete", ref, true)); }
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); } }
boolean siteUpdate = SecurityService.unlock("site.upd", site.getReference());
boolean siteUpdate = SecurityService.unlock("site.upd", site.getReference());