1 6 7 package org.manentia.kasai.authobject; 8 9 import com.koala.commons.log.Log; 10 import java.util.Collection ; 11 import org.apache.commons.lang.StringUtils; 12 import org.manentia.kasai.AuthObject; 13 import org.manentia.kasai.KasaiFacade; 14 import org.manentia.kasai.util.Constants; 15 import org.manentia.kasai.User; 16 import org.manentia.kasai.exceptions.*; 17 18 22 public class AuthObjectHandler { 23 private static AuthObjectHandler instance; 24 25 private AuthObjectHandler(){} 26 27 public static synchronized AuthObjectHandler getInstance(){ 28 if (instance == null){ 29 instance = new AuthObjectHandler(); 30 } 31 32 return instance; 33 } 34 35 public void copyPermissionsFromObject (String sourceObject, String destinationObject) throws DoesntExistsException,DataAccessException { 36 AuthObjectDAOFactory.getInstance().createDAO().copyPermissionsFromObject(sourceObject, destinationObject); 37 } 38 39 public void create(String object) throws DataAccessException{ 40 AuthObjectDAOFactory.getInstance().createDAO().create(object); 41 } 42 43 public void createObjectGroupRole(String object, String group, int role) throws DoesntExistsException,DataAccessException{ 44 AuthObjectDAOFactory.getInstance().createDAO().createObjectGroupRole(object, group, role); 45 } 46 47 public void createObjectUserRole(String object, String login, int role) throws DoesntExistsException,DataAccessException{ 48 AuthObjectDAOFactory.getInstance().createDAO().createObjectUserRole(object, login, role); 49 } 50 51 public void delete(String object) throws DataAccessException{ 52 AuthObjectDAOFactory.getInstance().createDAO().delete(object); 53 } 54 55 public void deleteObjectGroupRole(int id) throws DataAccessException{ 56 AuthObjectDAOFactory.getInstance().createDAO().deleteObjectGroupRole(id); 57 } 58 59 public void deleteObjectUserRole(int id) throws DataAccessException{ 60 AuthObjectDAOFactory.getInstance().createDAO().deleteObjectUserRole(id); 61 } 62 63 public void deleteObjectUserRole(String login, String object, int role) throws DataAccessException{ 64 AuthObjectDAOFactory.getInstance().createDAO().deleteObjectUserRole(login, object, role); 65 } 66 67 public void deleteObjectUserRole(String login, String object) throws DataAccessException{ 68 AuthObjectDAOFactory.getInstance().createDAO().deleteObjectUserRole(login, object); 69 } 70 71 public Collection listObjectGroupsRoles(String object) throws DataAccessException { 72 return AuthObjectDAOFactory.getInstance().createDAO().listObjectGroupsRoles(object); 73 } 74 75 public Collection listObjectUsersRoles(String object) throws DataAccessException{ 76 return AuthObjectDAOFactory.getInstance().createDAO().listObjectUsersRoles(object); 77 } 78 79 public AuthObject read(String id) throws DataAccessException{ 80 return AuthObjectDAOFactory.getInstance().createDAO().read(id); 81 } 82 } 83
| Popular Tags
|