| 1 5 package com.nightlabs.ipanema.security.registry; 6 7 import com.nightlabs.ModuleException; 8 import com.nightlabs.ipanema.base.IpanemaBasePrincipal; 9 10 14 public class SecurityRegistrarImpl implements SecurityRegistrar 15 { 16 private IpanemaBasePrincipal principal; 17 private SecurityRegistrarFactoryImpl smf; 18 19 public SecurityRegistrarImpl(SecurityRegistrarFactoryImpl _smf, IpanemaBasePrincipal _principal) 20 { 21 this.smf = _smf; 22 this.principal = _principal; 23 } 24 25 public void linkAuthority(String objectID, String authorityID) 26 throws ModuleException 27 { 28 smf.linkAuthority(this.principal.getOrganisationID(), objectID, authorityID); 29 } 30 31 public void unlinkAuthority(String objectID, String authorityID) 32 throws ModuleException 33 { 34 smf.unlinkAuthority(this.principal.getOrganisationID(), objectID, authorityID); 35 } 36 37 public boolean isAuthorised(String objectID, String roleID) 38 throws ModuleException 39 { 40 return smf.isAuthorised(this.principal.getOrganisationID(), this.principal.getUserID(), objectID, roleID); 41 } 42 43 public void assertAuthorised(String objectID, String roleID) 44 throws ModuleException 45 { 46 smf.assertAuthorised(this.principal.getOrganisationID(), this.principal.getUserID(), objectID, roleID); 47 } 48 49 } 50 | Popular Tags |