Package org.silverpeas.core.admin
Class BaseRightProfile
- java.lang.Object
-
- org.silverpeas.core.admin.BaseRightProfile
-
- All Implemented Interfaces:
Serializable
,RightProfile
- Direct Known Subclasses:
ProfileInst
,SpaceProfileInst
public abstract class BaseRightProfile extends Object implements RightProfile, Serializable
- Author:
- mmoquillon
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
BaseRightProfile()
Creates an empty profile of rights access.protected
BaseRightProfile(BaseRightProfile profile)
Creates a profile as a copy of the specified one.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addGroup(String sGroupId)
Adds among the groups covered by this profile the specified group.void
addGroups(List<String> groups)
Adds all the specified groups in this profile.void
addUser(String sUserId)
Adds a user as being covered by this profile.void
addUsers(List<String> users)
Adds all the specified users in this profile.List<String>
getAllGroups()
Gets all the groups that are concerned by this profile.List<String>
getAllUsers()
Gets all the users concerned by this profile.String
getDescription()
Gets a short description of this profile.String
getId()
Gets a unique identifier of this profile.String
getLabel()
Gets a label of this profile.String
getName()
Gets the name of this profile.int
getNumGroup()
Gets the number of groups that are concerned by this profileint
getNumUser()
Gets the number of users covered by this profile.boolean
isEmpty()
Is this right profile empty?boolean
isInherited()
Is the right accesses defined by this profile are inherited by another right profile, a parent right profile?void
removeAllGroups()
Removes all the groups concerned by this profile.void
removeAllUsers()
Removes all the users concerned by this profile.void
removeGroup(String sGroupId)
Removes from the groups concerned by this profile the specified group.void
removeUser(String sUserId)
Removes the specified user among those covered by this profile.void
setDescription(String sDescription)
Sets a short description to this profilevoid
setGroups(List<String> groups)
void
setId(String sId)
Sets a unique identifier to this profile.void
setInherited(boolean isInherited)
Sets the inheritance in right accesses to this profile.void
setLabel(String sLabel)
Sets a label to this profile.void
setName(String sName)
Sets a name to this profile.void
setUsers(List<String> users)
-
-
-
Constructor Detail
-
BaseRightProfile
protected BaseRightProfile()
Creates an empty profile of rights access.
-
BaseRightProfile
protected BaseRightProfile(BaseRightProfile profile)
Creates a profile as a copy of the specified one. The identifier isn't copied as it should be unique.- Parameters:
profile
- the rights profile to copy.
-
-
Method Detail
-
setId
public void setId(String sId)
Sets a unique identifier to this profile. Shouldn't be used. Reserved to the persistence layer.- Parameters:
sId
- the unique identifier of the profile.
-
getId
public String getId()
Gets a unique identifier of this profile.- Returns:
- the profile identifier.
-
setName
public void setName(String sName)
Sets a name to this profile. The name of the profile defines by convention the privileges that are granted to the users and groups defined in this profile. In Silverpeas, the privileges are defined by convention in different predefined roles, and it is the name of this role that should be set here.- Parameters:
sName
- the name of the role referred by this profile.
-
getName
public String getName()
Gets the name of this profile. The name of the profile defines by convention the privileges that are granted to the users and groups defined in this profile. In Silverpeas, the privileges are defined by convention in different predefined roles, and it is the name of this role that is returned here.- Returns:
- the name of the role referred by this profile.
-
setLabel
public void setLabel(String sLabel)
Sets a label to this profile. A label is a user-friendly name given to this profile.- Parameters:
sLabel
- a label to give to this profile.
-
getLabel
public String getLabel()
Gets a label of this profile. A label is a user-friendly name given to this profile.- Returns:
- the profile label.
-
setDescription
public void setDescription(String sDescription)
Sets a short description to this profile- Parameters:
sDescription
- a textual description.
-
getDescription
public String getDescription()
Gets a short description of this profile.- Returns:
- the profile description.
-
isInherited
public boolean isInherited()
Is the right accesses defined by this profile are inherited by another right profile, a parent right profile?- Returns:
- true if the right accesses are inherited. False otherwise.
-
setInherited
public void setInherited(boolean isInherited)
Sets the inheritance in right accesses to this profile.- Parameters:
isInherited
- a boolean indicating if the right accesses are inherited from another right profile.
-
getNumGroup
public int getNumGroup()
Gets the number of groups that are concerned by this profile- Returns:
- the number of groups.
-
addGroup
public void addGroup(String sGroupId)
Adds among the groups covered by this profile the specified group.- Specified by:
addGroup
in interfaceRightProfile
- Parameters:
sGroupId
- the unique identifier of a group.
-
removeGroup
public void removeGroup(String sGroupId)
Removes from the groups concerned by this profile the specified group.- Specified by:
removeGroup
in interfaceRightProfile
- Parameters:
sGroupId
- the unique identifier of a group.
-
getAllGroups
public List<String> getAllGroups()
Gets all the groups that are concerned by this profile.- Specified by:
getAllGroups
in interfaceRightProfile
- Returns:
- a list of group identifiers.
-
removeAllGroups
public void removeAllGroups()
Removes all the groups concerned by this profile.
-
getNumUser
public int getNumUser()
Gets the number of users covered by this profile.- Returns:
- the number of users in this profile.
-
addUser
public void addUser(String sUserId)
Adds a user as being covered by this profile.- Specified by:
addUser
in interfaceRightProfile
- Parameters:
sUserId
- a unique identifier of a user.
-
removeUser
public void removeUser(String sUserId)
Removes the specified user among those covered by this profile.- Specified by:
removeUser
in interfaceRightProfile
- Parameters:
sUserId
- a unique identifier of a user.
-
getAllUsers
public List<String> getAllUsers()
Gets all the users concerned by this profile.- Specified by:
getAllUsers
in interfaceRightProfile
- Returns:
- a list of user identifiers.
-
removeAllUsers
public void removeAllUsers()
Removes all the users concerned by this profile.
-
addUsers
public void addUsers(List<String> users)
Adds all the specified users in this profile.- Parameters:
users
- a list of user identifiers.
-
addGroups
public void addGroups(List<String> groups)
Adds all the specified groups in this profile.- Parameters:
groups
- a list of group identifiers.
-
isEmpty
public boolean isEmpty()
Is this right profile empty?- Returns:
- true if no users or groups are concerned by this right profile. False otherwise.
-
-