Class CmsPermissionBean
- java.lang.Object
-
- org.opencms.ui.dialogs.permissions.CmsPermissionBean
-
public class CmsPermissionBean extends java.lang.Object
Bean for permissions which have changed.
-
-
Constructor Summary
Constructors Constructor Description CmsPermissionBean(java.lang.String principalType, java.lang.String principalName)
Constructor for delete permission.CmsPermissionBean(java.lang.String principalType, java.lang.String principalName, int allowed, int denied, int flags)
Constructor for new or edited permission.CmsPermissionBean(java.lang.String principalType, java.lang.String principalName, java.lang.String permissionString)
Constructor with permission string.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object o)
int
getAllowed()
Gets the allowed flag.static CmsPermissionBean
getBeanForPrincipal(java.util.Set<CmsPermissionBean> beans, java.lang.String principalName)
Gets the bean for principal from list of beans.int
getDenied()
Gets the denied flag.int
getFlags()
Gets the flag.java.lang.String
getPermissionString()
Returns the permission string.java.lang.String
getPrincipalName()
Gets the principal name.static java.lang.String
getPrincipalNameFromACE(CmsObject cms, CmsAccessControlEntry entry)
Get name of principal from ACE.java.lang.String
getPrincipalType()
Gets the type of the principal.int
hashCode()
boolean
isDeleted()
Returns whether the permission should be removed.boolean
isRealPrinciple()
Checks if principal is real.void
setFlags(int flags)
Sets the flag of the ACE.CmsAccessControlEntry
toAccessControlEntry(CmsObject cms, CmsUUID resID)
Creates ACE from bean.
-
-
-
Constructor Detail
-
CmsPermissionBean
public CmsPermissionBean(java.lang.String principalType, java.lang.String principalName)
Constructor for delete permission.- Parameters:
principalType
- principal typeprincipalName
- principal name
-
CmsPermissionBean
public CmsPermissionBean(java.lang.String principalType, java.lang.String principalName, int allowed, int denied, int flags)
Constructor for new or edited permission.- Parameters:
principalType
- principal typeprincipalName
- principal nameallowed
- intdenied
- intflags
- int
-
CmsPermissionBean
public CmsPermissionBean(java.lang.String principalType, java.lang.String principalName, java.lang.String permissionString)
Constructor with permission string.- Parameters:
principalType
- typeprincipalName
- namepermissionString
- permission string
-
-
Method Detail
-
getBeanForPrincipal
public static CmsPermissionBean getBeanForPrincipal(java.util.Set<CmsPermissionBean> beans, java.lang.String principalName)
Gets the bean for principal from list of beans.- Parameters:
beans
- to look principal upprincipalName
- name of principal to get bean of- Returns:
- CmsPermissionBean
-
getPrincipalNameFromACE
public static java.lang.String getPrincipalNameFromACE(CmsObject cms, CmsAccessControlEntry entry)
Get name of principal from ACE.- Parameters:
cms
- CmsObjectentry
- ACE- Returns:
- principal name
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
- See Also:
Object.equals(java.lang.Object)
-
getAllowed
public int getAllowed()
Gets the allowed flag.- Returns:
- int
-
getDenied
public int getDenied()
Gets the denied flag.- Returns:
- int
-
getFlags
public int getFlags()
Gets the flag.- Returns:
- int
-
getPermissionString
public java.lang.String getPermissionString()
Returns the permission string.- Returns:
- the permission string or null if not set
-
getPrincipalName
public java.lang.String getPrincipalName()
Gets the principal name.- Returns:
- the name of the principal
-
getPrincipalType
public java.lang.String getPrincipalType()
Gets the type of the principal.- Returns:
- String
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
- See Also:
Object.hashCode()
-
isDeleted
public boolean isDeleted()
Returns whether the permission should be removed.- Returns:
- true-> permission will be removed
-
isRealPrinciple
public boolean isRealPrinciple()
Checks if principal is real.- Returns:
- true if principal is real
-
setFlags
public void setFlags(int flags)
Sets the flag of the ACE.- Parameters:
flags
- to be set
-
toAccessControlEntry
public CmsAccessControlEntry toAccessControlEntry(CmsObject cms, CmsUUID resID)
Creates ACE from bean.- Parameters:
cms
- CmsObjectresID
- id of resource- Returns:
- CmsAccessControlEntry
-
-