Examples of SecurityException


Examples of de.suse.swamp.core.util.SecurityException

        return SecurityManager.getUser(username);
    }  
   
    public void doEmptyUsercache(String uname) throws StorageException, UnknownElementException, SecurityException {
        if (!SecurityManager.isGroupMember(SecurityManager.getUser(uname), "swampadmins")) {
            throw new SecurityException("Not allowed to truncate user-cache.");
        }
        SecurityManager.clearCache();
    }
View Full Code Here

Examples of de.suse.swamp.core.util.SecurityException

        SecurityManager.clearCache();
    }

    public int doGetUserCacheSize(String username) throws SecurityException, UnknownElementException, StorageException {
        if (!SecurityManager.isGroupMember(SecurityManager.getUser(username), "swampadmins")) {
            throw new SecurityException("No permission to read Usercache!");
        }
        return SecurityManager.getCacheSize();
    }
View Full Code Here

Examples of de.suse.swamp.core.util.SecurityException

        WorkflowRole role = wfTemp.getWorkflowRole(groupName);
        if (role == null) {
            throw new UnknownElementException("Role " + groupName + " not found for template: " + wfName);
        }
        if (!wfTemp.hasRole(username, WorkflowRole.ADMIN)) {
            throw new SecurityException("You need to be admin of " + wfName + " to change role memberships");
        }
        if (!(role instanceof DbReferencesRole)) {
            throw new UnknownElementException("Can only change members of DbReferencesRole types");
        }
        return ((DbReferencesRole) role).addMember(targetUser);
View Full Code Here

Examples of de.suse.swamp.core.util.SecurityException

        WorkflowRole role = wfTemp.getWorkflowRole(groupName);
        if (role == null) {
            throw new UnknownElementException("Role " + groupName + " not found for template: " + wfName);
        }
        if (!wfTemp.hasRole(username, WorkflowRole.ADMIN)) {
            throw new SecurityException("You need to be admin of " + wfName + " to change role memberships");
        }
        if (!(role instanceof DbReferencesRole)) {
            throw new UnknownElementException("Can only change members of DbReferencesRole types");
        }
        return ((DbReferencesRole) role).removeMember(targetUser);
View Full Code Here

Examples of de.suse.swamp.core.util.SecurityException

        if (!(checkTask.getActionTemplate() instanceof UserActionTemplate)){
            throw new UnknownElementException("Cannot work on a systemtask. (wrong task-id " + taskId + "?)");
        }
        UserActionTemplate actionTemplate = (UserActionTemplate) checkTask.getActionTemplate();
        if (actionTemplate.isRestricted() && !wf.hasRole(username, actionTemplate.getRoleName())) {
      throw new SecurityException("You are not authorized to work on this Task! " +
                    "Required role: " + actionTemplate.getRoleName());
    }
    }
View Full Code Here

Examples of de.suse.swamp.core.util.SecurityException

    public void cancelAllTasks(int wfid, String username) throws SecurityException,
        UnknownElementException, StorageException {

        Workflow wf = new WorkflowAPI().getWorkflow(wfid, username);
        if (!wf.hasRole(username, WorkflowRole.ADMIN)){
            throw new SecurityException("Must be admin to cancel all Tasks!");
        }
        TaskManager.cancelTasks(wfid, username);
    }
View Full Code Here

Examples of de.suse.swamp.core.util.SecurityException

    }

    public int doGetTaskCacheSize(String username) throws SecurityException,
        UnknownElementException, StorageException {
        if (!SecurityManager.isGroupMember(SecurityManager.getUser(username), "swampadmins")){
            throw new SecurityException("No permission to read Taskcache!");
        }
        return TaskManager.getCacheSize();
    }  
View Full Code Here

Examples of de.suse.swamp.core.util.SecurityException

    }  
   
   
    public void doEmptyTaskcache(String uname) throws StorageException, UnknownElementException, SecurityException {
        if (!SecurityManager.isGroupMember(SecurityManager.getUser(uname), "swampadmins")) {
            throw new SecurityException("Not allowed to truncate task-cache.");
        }
        TaskManager.clearCache();
    }
View Full Code Here

Examples of de.suse.swamp.core.util.SecurityException

    WorkflowAPI wfapi = new WorkflowAPI();
        Workflow wf = wfapi.getWorkflow(e.getTargetWfId(), username);
       
        // FIXME: Users can send all events to a workflow...
        if (!wf.hasRole(username, WorkflowRole.USER)){
      throw new SecurityException("Need to be in role user to send event!");
    }
        EventManager.handleWorkflowEvent(e, username, history);
        return history;
  }
View Full Code Here

Examples of de.suse.swamp.core.util.SecurityException

        for (Iterator it = l.iterator(); it.hasNext();) {
            Event e = (Event) it.next();
            Workflow wf = wfapi.getWorkflow(e.getTargetWfId(), username);
            if (!wf.hasRole(username, WorkflowRole.USER)) {
                throw new SecurityException("Need to be in role user to send event!");
            }
            EventManager.handleWorkflowEvent(e, username, history);
        }
        return history;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.