|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.safehaus.triplesec.guardian.Profile
public class Profile
A user's application authorization profile. Authorization policy is used
to manage access controls for user profiles associated with applications.
Profiles associate users with applications. This class models that profile
by linking the user with an application and allowing the assignment of
application specific Roles and Permissions to the profile.
Profiles contain three sets of Permissions and a set of
Roles used for managing an authorization policy of a user. A Role
Based Access Control (RBAC) model is used to easily manage the Profile.
The three Permission sets are: grants, denials and the effective
calculated permissions for the profile. Roles assigned to the Profile lead
to the inheritance of Permissions granted to Role. Besides
Role based Permission inheritence, additional
Permissions may be granted or denied to influence the total
effective Permissions. The grants Permissions set contains
extra granted Permissions which may not be inherited by assigned
Roles. The denials Permissions set contains
Permissions that are denied whether they are inherited by assigned
Roles or granted through the grants Permissions set. Denials
take precedence. For more information take a look at the documentation here:
| Constructor Summary | |
|---|---|
Profile(ApplicationPolicy store,
java.lang.String profileId,
java.lang.String userName,
Roles roles,
Permissions grants,
Permissions denials)
Creates a default User Profile for an ApplicationPolicyStore. |
|
Profile(ApplicationPolicy store,
java.lang.String profileId,
java.lang.String userName,
Roles roles,
Permissions grants,
Permissions denials,
java.lang.String description)
Creates a default User Profile for an ApplicationPolicyStore. |
|
| Method Summary | |
|---|---|
void |
checkPermission(Permission permission)
Assertive permission check to test if this Profile has the effective permission. |
void |
checkPermission(Permission permission,
java.lang.String message)
Assertive permission check to test if this Profile has the effective permission. |
void |
checkPermission(java.lang.String permissionName)
Assertive check to test if this Profile has the effective Permission. |
void |
checkPermission(java.lang.String permissionName,
java.lang.String message)
Assertive permission check to test if this Profile has the effective permission. |
java.lang.Object |
clone()
|
int |
compareTo(java.lang.Object that)
|
boolean |
equals(java.lang.Object that)
|
java.lang.String |
getApplicationName()
Gets the name of the application this Profile is associated with. |
Permissions |
getDenials()
Gets a set of permissions explicitly denied by this profile. |
java.lang.String |
getDescription()
Gets a brief description for this Profile if one exists. |
Permissions |
getEffectivePermissions()
Gets the set of effective (net calculated) permissions for this Profile. |
Permissions |
getGrants()
Gets the set of Permissions granted to this Profile. |
java.lang.String |
getProfileId()
Gets the id of the this Profile. |
Roles |
getRoles()
Gets a set of Roles which are assigned to this Profile. |
java.lang.String |
getUserName()
Gets the name of the user who owns this Profile. |
int |
hashCode()
|
boolean |
hasPermission(Permission permission)
Get's whether or not this Profile has the permission. |
boolean |
hasPermission(java.lang.String permissionName)
Get's whether or not this Profile has the permission. |
boolean |
isInRole(java.lang.String roleName)
Checks to see if the user according to this Profile is in a Role. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Profile(ApplicationPolicy store,
java.lang.String profileId,
java.lang.String userName,
Roles roles,
Permissions grants,
Permissions denials)
profileId - the id of this ProfileuserName - the name of the User this Profile is forstore - the store this Profile is forroles - the roles assigned to this Profilegrants - the permissions granted to this Profiledenials - the permissions denied by this Profile
public Profile(ApplicationPolicy store,
java.lang.String profileId,
java.lang.String userName,
Roles roles,
Permissions grants,
Permissions denials,
java.lang.String description)
profileId - the name of the User this Profile is forstore - the store this Profile is forroles - the roles assigned to this Profilegrants - the permissions granted to this Profiledenials - the permissions denied by this Profiledescription - a brief description for this Profile| Method Detail |
|---|
public java.lang.String getProfileId()
public java.lang.String getUserName()
public java.lang.String getDescription()
public java.lang.String getApplicationName()
public Roles getRoles()
Roles which are assigned to this Profile.
Role objects which are assigned to this Profilepublic boolean isInRole(java.lang.String roleName)
roleName - the name of the Role to check for
public Permissions getGrants()
Permissions granted to this Profile.
Permission objectspublic Permissions getDenials()
Permission objectspublic Permissions getEffectivePermissions()
Roles,
granted Permissions and denied Permissions of this
Profile.
Permission objects for this profile.public void checkPermission(java.lang.String permissionName)
Permission.
permissionName - the permission name to check for
java.security.AccessControlException - if the permission is not granted or
inherited from an assigned Rolepublic boolean hasPermission(Permission permission)
permission - the permission to check for
public boolean hasPermission(java.lang.String permissionName)
permissionName - the permission to check for
public void checkPermission(Permission permission)
permission - the permission to check for
java.security.AccessControlException - if the permission is not granted or
inherited from an assigned Role
public void checkPermission(java.lang.String permissionName,
java.lang.String message)
permissionName - the permission name to check formessage - to use for AccessControlException if it is thrown
java.security.AccessControlException - if the permission is not granted or
inherited from an assigned Role
public void checkPermission(Permission permission,
java.lang.String message)
permission - the permission to check formessage - to use for AccessControlException if it is thrown
java.security.AccessControlException - if the permission is not granted or
inherited from an assigned Rolepublic int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object that)
equals in class java.lang.Objectpublic int compareTo(java.lang.Object that)
compareTo in interface java.lang.Comparablepublic java.lang.Object clone()
clone in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||