|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.alfresco.repo.security.authority.SimpleAuthorityServiceImpl
public class SimpleAuthorityServiceImpl
The default implementation of the authority service.
Field Summary |
---|
Fields inherited from interface org.alfresco.service.cmr.security.AuthorityService |
---|
ZONE_APP_DEFAULT, ZONE_APP_SHARE, ZONE_APP_WCM, ZONE_AUTH_ALFRESCO, ZONE_AUTH_EXT_PREFIX |
Constructor Summary | |
---|---|
SimpleAuthorityServiceImpl()
|
Method Summary | |
---|---|
void |
addAuthority(java.util.Collection parentNames,
java.lang.String childName)
Set a given child authority to be included by the given parent authorities. |
void |
addAuthority(java.lang.String parentName,
java.lang.String childName)
Set an authority to include another authority. |
void |
addAuthorityToZones(java.lang.String authorityName,
java.util.Set zones)
Add a zone to an authority. |
boolean |
authorityExists(java.lang.String name)
Check if an authority exists. |
java.lang.String |
createAuthority(org.alfresco.service.cmr.security.AuthorityType type,
java.lang.String shortName)
Create an authority. |
java.lang.String |
createAuthority(org.alfresco.service.cmr.security.AuthorityType type,
java.lang.String shortName,
java.lang.String authorityDisplayName,
java.util.Set authorityZones)
Create an authority with a display name and zone. |
void |
deleteAuthority(java.lang.String name)
Delete an authority and all its relationships. |
void |
deleteAuthority(java.lang.String name,
boolean cascade)
Delete an authority and all its relationships, optionally recursively deleting child authorities of the same type. |
java.util.Set |
findAuthorities(org.alfresco.service.cmr.security.AuthorityType type,
java.lang.String parentAuthority,
boolean immediate,
java.lang.String displayNamePattern,
java.lang.String zoneName)
Find authorities by pattern matching (* and ?) against the authority name. |
java.util.Set |
getAllAuthorities(org.alfresco.service.cmr.security.AuthorityType type)
Get all authorities by type. |
java.util.Set |
getAllAuthoritiesInZone(java.lang.String zoneName,
org.alfresco.service.cmr.security.AuthorityType type)
Gets the names of all authorities in a zone, optionally filtered by type. |
java.util.Set |
getAllRootAuthorities(org.alfresco.service.cmr.security.AuthorityType type)
Get all root authorities by type. |
java.util.Set |
getAllRootAuthoritiesInZone(java.lang.String zoneName,
org.alfresco.service.cmr.security.AuthorityType type)
Gets the names of all authorities in a zone, optionally filtered by type. |
java.util.Set |
getAuthorities()
Get the authorities for the current user |
java.util.Set |
getAuthoritiesForUser(java.lang.String currentUserName)
Get the authorities for the given user |
java.lang.String |
getAuthorityDisplayName(java.lang.String name)
Get the display name for the given authority. |
java.util.Set |
getAuthorityZones(java.lang.String name)
Gets the name of the zone containing the specified authority. |
java.util.Set |
getContainedAuthorities(org.alfresco.service.cmr.security.AuthorityType type,
java.lang.String name,
boolean immediate)
Get all the authorities that are contained by the given authority. |
java.util.Set |
getContainingAuthorities(org.alfresco.service.cmr.security.AuthorityType type,
java.lang.String name,
boolean immediate)
Get the authorities that contain the given authority For example, this can be used find out all the authorities that contain a user. |
java.util.Set |
getDefaultZones()
Get the name of the default zone. |
java.lang.String |
getName(org.alfresco.service.cmr.security.AuthorityType type,
java.lang.String shortName)
Create the full identifier for an authority given its short name and type. |
org.alfresco.service.cmr.repository.NodeRef |
getOrCreateZone(java.lang.String zoneName)
Gets or creates an authority zone node with the specified name |
java.lang.String |
getShortName(java.lang.String name)
Extract the short name of an authority from its full identifier. |
org.alfresco.service.cmr.repository.NodeRef |
getZone(java.lang.String zoneName)
Gets an authority zone node with the specified name |
boolean |
hasAdminAuthority()
Check of the current user has admin authority. |
boolean |
hasGuestAuthority()
Check of the current user has guest authority. |
boolean |
isAdminAuthority(java.lang.String authorityName)
Does the given authority have admin authority. |
boolean |
isGuestAuthority(java.lang.String authorityName)
Does the given authority have guest authority. |
void |
removeAuthority(java.lang.String parentName,
java.lang.String childName)
Remove an authority as a member of another authority. |
void |
removeAuthorityFromZones(java.lang.String authorityName,
java.util.Set zones)
Remove a zone from an authority |
void |
setAdminUsers(java.util.Set adminUsers)
|
void |
setAuthenticationContext(AuthenticationContext authenticationContext)
|
void |
setAuthorityDisplayName(java.lang.String authorityName,
java.lang.String authorityDisplayName)
Set the display name for the given authority. |
void |
setGuestUsers(java.util.Set guestUsers)
|
void |
setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
|
void |
setPersonService(PersonService personService)
|
void |
setTenantService(org.alfresco.repo.tenant.TenantService tenantService)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SimpleAuthorityServiceImpl()
Method Detail |
---|
public void setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
public void setPersonService(PersonService personService)
public void setTenantService(org.alfresco.repo.tenant.TenantService tenantService)
public boolean hasAdminAuthority()
AuthorityService
hasAdminAuthority
in interface AuthorityService
public boolean isAdminAuthority(java.lang.String authorityName)
AuthorityService
isAdminAuthority
in interface AuthorityService
authorityName
- The name of the authority.
public boolean hasGuestAuthority()
AuthorityService
hasGuestAuthority
in interface AuthorityService
public boolean isGuestAuthority(java.lang.String authorityName)
AuthorityService
isGuestAuthority
in interface AuthorityService
authorityName
- The name of the authority.
public void setAuthenticationContext(AuthenticationContext authenticationContext)
public void setAdminUsers(java.util.Set adminUsers)
public void setGuestUsers(java.util.Set guestUsers)
public java.util.Set getAuthorities()
AuthorityService
getAuthorities
in interface AuthorityService
public java.util.Set getAllAuthorities(org.alfresco.service.cmr.security.AuthorityType type)
AuthorityService
getAllAuthorities
in interface AuthorityService
type
- -
the type of authorities.
public void addAuthority(java.lang.String parentName, java.lang.String childName)
AuthorityService
addAuthority
in interface AuthorityService
parentName
- -
the full name string identifier for the parent.childName
- -
the string identifier for the child.public void addAuthority(java.util.Collection parentNames, java.lang.String childName)
AuthorityService
addAuthority
in interface AuthorityService
parentNames
- -
the full name string identifier for the parents.childName
- -
the string identifier for the child.public java.lang.String createAuthority(org.alfresco.service.cmr.security.AuthorityType type, java.lang.String shortName)
AuthorityService
createAuthority
in interface AuthorityService
type
- -
the type of the authorityshortName
- -
the short name of the authority to create
this will also be set as the default display name for the authority
public void deleteAuthority(java.lang.String name)
AuthorityService
deleteAuthority
in interface AuthorityService
public void deleteAuthority(java.lang.String name, boolean cascade)
AuthorityService
deleteAuthority
in interface AuthorityService
name
- the authority long namecascade
- should the delete be cascaded to child authorities of the same type?public java.util.Set getAllRootAuthorities(org.alfresco.service.cmr.security.AuthorityType type)
AuthorityService
getAllRootAuthorities
in interface AuthorityService
type
- -
the type of the authority
public java.util.Set getContainedAuthorities(org.alfresco.service.cmr.security.AuthorityType type, java.lang.String name, boolean immediate)
AuthorityService
getContainedAuthorities
in interface AuthorityService
type
- -
if not null, limit to the type of authority specifiedname
- -
the name of the containing authorityimmediate
- -
if true, limit the depth to just immediate child, if false
find authorities at any depth
public java.util.Set getContainingAuthorities(org.alfresco.service.cmr.security.AuthorityType type, java.lang.String name, boolean immediate)
AuthorityService
getContainingAuthorities
in interface AuthorityService
type
- -
if not null, limit to the type of authority specifiedname
- -
the name of the authority for which the containing authorities
are required.immediate
- -
limit to immediate parents or any ancestor.
public java.lang.String getName(org.alfresco.service.cmr.security.AuthorityType type, java.lang.String shortName)
AuthorityService
getName
in interface AuthorityService
public java.lang.String getShortName(java.lang.String name)
AuthorityService
getShortName
in interface AuthorityService
public void removeAuthority(java.lang.String parentName, java.lang.String childName)
AuthorityService
removeAuthority
in interface AuthorityService
parentName
- -
the string identifier for the parent.childName
- -
the string identifier for the child.public boolean authorityExists(java.lang.String name)
AuthorityService
authorityExists
in interface AuthorityService
name
- (the long name).
public java.util.Set getAuthoritiesForUser(java.lang.String currentUserName)
AuthorityService
getAuthoritiesForUser
in interface AuthorityService
public java.lang.String getAuthorityDisplayName(java.lang.String name)
AuthorityService
getAuthorityDisplayName
in interface AuthorityService
name
- - the full authority string including any prefix (e.g. GROUP_woof)
public void setAuthorityDisplayName(java.lang.String authorityName, java.lang.String authorityDisplayName)
AuthorityService
setAuthorityDisplayName
in interface AuthorityService
public java.util.Set getAllAuthoritiesInZone(java.lang.String zoneName, org.alfresco.service.cmr.security.AuthorityType type)
AuthorityService
getAllAuthoritiesInZone
in interface AuthorityService
zoneName
- the zone nametype
- the authority type to filter by or null
for all authority types
public org.alfresco.service.cmr.repository.NodeRef getOrCreateZone(java.lang.String zoneName)
AuthorityService
getOrCreateZone
in interface AuthorityService
zoneName
- the zone name
public void addAuthorityToZones(java.lang.String authorityName, java.util.Set zones)
AuthorityService
addAuthorityToZones
in interface AuthorityService
public java.lang.String createAuthority(org.alfresco.service.cmr.security.AuthorityType type, java.lang.String shortName, java.lang.String authorityDisplayName, java.util.Set authorityZones)
AuthorityService
createAuthority
in interface AuthorityService
type
- the type of the authorityshortName
- the short name of the authority to createauthorityDisplayName
- the display name for the authority
public java.util.Set getAllRootAuthoritiesInZone(java.lang.String zoneName, org.alfresco.service.cmr.security.AuthorityType type)
AuthorityService
getAllRootAuthoritiesInZone
in interface AuthorityService
zoneName
- the zone nametype
- the authority type to filter by or null
for all authority types
public java.util.Set getAuthorityZones(java.lang.String name)
AuthorityService
getAuthorityZones
in interface AuthorityService
name
- the authority long name
AuthorityService#DEFAULT_ZONE
if the
authority exists but has no zone, or null
if the authority does not exist.public java.util.Set getDefaultZones()
AuthorityService
getDefaultZones
in interface AuthorityService
public void removeAuthorityFromZones(java.lang.String authorityName, java.util.Set zones)
AuthorityService
removeAuthorityFromZones
in interface AuthorityService
public org.alfresco.service.cmr.repository.NodeRef getZone(java.lang.String zoneName)
AuthorityService
getZone
in interface AuthorityService
zoneName
- the zone name
public java.util.Set findAuthorities(org.alfresco.service.cmr.security.AuthorityType type, java.lang.String parentAuthority, boolean immediate, java.lang.String displayNamePattern, java.lang.String zoneName)
AuthorityService
findAuthorities
in interface AuthorityService
parentAuthority
- if non-null, will look only for authorities who are a child of the named parentimmediate
- if true
then only search root groups if parentAuthority is null, or immediate children of parentAuthority if it is non-null.zoneName
- - may be null to indicate all zones
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |