1 17 18 19 20 package org.apache.lenya.cms.ac.usecase; 21 22 import java.util.HashMap ; 23 import java.util.Map ; 24 25 public class UsecaseRoles { 26 27 private Map usecaseToRoles = new HashMap (); 28 29 32 public UsecaseRoles() { 33 } 34 35 40 public void setRoles(String usecaseId, String [] roleIds) { 41 usecaseToRoles.put(usecaseId, roleIds); 42 } 43 44 50 public String [] getRoles(String usecaseId) { 51 String [] usecaseRoles; 52 if (usecaseToRoles.containsKey(usecaseId)) { 53 usecaseRoles = (String []) usecaseToRoles.get(usecaseId); 54 } else { 55 usecaseRoles = new String [0]; 56 } 57 return usecaseRoles; 58 } 59 60 65 public boolean hasRoles(String usecaseId) { 66 return usecaseToRoles.containsKey(usecaseId); 67 } 68 69 } 70 | Popular Tags |