Package de.suse.swamp.core.util

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


    public void doRunjob(RunData data, Context context) throws Exception {
       
        SWAMPUser user = ((SWAMPTurbineUser) data.getUser()).getSWAMPUser();
       
        if (!de.suse.swamp.core.container.SecurityManager.isGroupMember(user, "swampadmins"))
            throw new SecurityException("No permission (needs group swampadmins)");
           
        int job = data.getParameters().getInt("job");
        JobEntry jobEntry = TurbineScheduler.getJob(job);
        SWAMPScheduledJob schedJob = (SWAMPScheduledJob) ScheduledJobLoader.getInstance().getInstance(jobEntry.getTask());
        schedJob.run(jobEntry);       
View Full Code Here


   
 
  public LRUMap doGetWorkflowCache(String username) throws SecurityException,
    UnknownElementException, StorageException {
    if (!SecurityManager.isGroupMember(SecurityManager.getUser(username), "swampadmins")){
      throw new SecurityException("No permission to read Workflowcache!");
    }
    return WorkflowManager.getInstance().getWorkflowCache();
  }
View Full Code Here

            UnknownElementException {
        Workflow wf = WorkflowManager.getInstance().getWorkflow(wfid);
        if (wf == null) {
            throw new UnknownElementException("Workflow #" + wfid + " not found");
        } else if (!wf.hasRole(username, WorkflowRole.USER)) {
            throw new SecurityException("No permission to read Workflow #"
                + wfid + " for " + username + ". (Not in role USER)");
        }
        return wf;
    }
View Full Code Here

   
    public Workflow getWorkflowForWriting(int wfid, String username) throws SecurityException, UnknownElementException {
        Workflow wf = this.getWorkflow(wfid, username);
        if (!wf.hasRole(username, WorkflowRole.ADMIN) &&
             !wf.hasRole(username, WorkflowRole.OWNER)){
            throw new SecurityException("No permission to write to Workflow #" + wfid + " for " + username);
        }
        return wf;
    }
View Full Code Here

        throws SecurityException, UnknownElementException {
        WorkflowTemplate wftemp = WorkflowManager.getInstance().getWorkflowTemplate(template);
        if (wftemp == null){
            throw new UnknownElementException("Template: " + template + " not found");
        } else if (!wftemp.hasRole(username, WorkflowRole.USER) && !wftemp.hasRole(username, WorkflowRole.STARTER)){
            throw new SecurityException("No permission to read template: " + template + " for " + username);
        }
        return wftemp;
    }
View Full Code Here

        WorkflowTemplate wftemp = WorkflowManager.getInstance().getWorkflowTemplate(template, version);

        if (wftemp == null) {
            throw new UnknownElementException("Template: " + template + " not found");
        } else if (!wftemp.hasRole(username, WorkflowRole.USER) && !wftemp.hasRole(username, WorkflowRole.STARTER)) {
            throw new SecurityException("No permission to read template: " + template + " for " + username);
        }
        return wftemp;
    }
View Full Code Here

            if (wf == null){
                throw new StorageException("Could not create Wf for Template: " +
                        name + ", version: " + version);
            }
        } else {
            throw new SecurityException("No permission to start instance of Workflow: " + name + version);
        }
        return wf;
    }
View Full Code Here

   
   
    public void storeWorkflow(Workflow wf, String uname)
        throws StorageException, SecurityException {
        if (!wf.hasRole(uname, WorkflowRole.USER)){
            throw new SecurityException("Not allowed to store Workflow: " + wf.getName());
        }
        WorkflowManager.storeWorkflow(wf);
    }
View Full Code Here

   
    public List reloadAllWorkflowDefinitions(String uname)
        throws StorageException, SecurityException, Exception {
        if (!SecurityManager.isGroupMember(
                SecurityManager.getUser(uname), "swampadmins")){
            throw new SecurityException("Not allowed to reload the Workflow definitions.");
        }
        return WorkflowManager.getInstance().reloadAllWorkflowDefinitions();      
    }
View Full Code Here

    public List reloadWorkflowDefinitions(String uname, String templateName)
        throws StorageException, SecurityException, Exception {
        WorkflowTemplate wftemp = getWorkflowTemplate(templateName, uname);
        // check if we are admin of the latest version.
        if (!wftemp.hasRole(uname, WorkflowRole.ADMIN)){
            throw new SecurityException("Not allowed to reload the Workflow definition.");
        }
        return WorkflowManager.getInstance().reloadWorkflowDefinitions(templateName);      
    }
View Full Code Here

TOP

Related Classes of de.suse.swamp.core.util.SecurityException

Copyright © 2018 www.massapicom. 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.