|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.yosokumo.core.Role
public class Role
A set of privileges granted to a particular user for a particular study. One of the privileges granted to a study creator is the authority to create new roles on the study for other enrolled users. In this way, the study creator can allow others to load data, get predictions, view study statistics, or even themselves grant privileges on the study to other users. Roles may be severely limited or provide full access and may be changed or revoked at any time.
When an enrolled user creates a study, he is authorized automatically to
perform any action on that study. More precisely, when a study is created,
the service simultaneously creates a role for the creator on the newly
created study in which all privileges are set to true
.
A single user may have a role on many studies; conversely, many users may have a role on a single study. The list of studies on which a particular user has a role is called the catalog for that user. The list of users that have a role on a particular study is called the roster for that study.
A Role
has these attributes:
Nested Class Summary | |
---|---|
static class |
Role.Privilege
Indicates an operation which a given user is or is not allowed to perform on a given study. |
Field Summary | |
---|---|
private java.util.BitSet |
privilegeSet
|
private java.lang.String |
roleLocation
|
private java.lang.String |
studyIdentifier
|
private java.lang.String |
studyName
|
private java.lang.String |
userIdentifier
|
private java.lang.String |
userName
|
Constructor Summary | |
---|---|
Role(java.lang.String userIdentifier,
java.lang.String studyIdentifier)
Initializes a newly created Role object with attributes
specified by the input parameters. |
Method Summary | |
---|---|
Role |
addAllPrivileges()
Add all privileges. |
Role |
addPrivilege(Role.Privilege privilege)
Add a privilege. |
boolean |
getPrivilege(Role.Privilege privilege)
Get a specific privilege. |
(package private) java.lang.String |
getRoleLocation()
Return the role location. |
java.lang.String |
getStudyIdentifier()
Return the study identifier. |
java.lang.String |
getStudyName()
Return the study name. |
java.lang.String |
getUserIdentifier()
Return the user identifier. |
java.lang.String |
getUserName()
Return the user name. |
Role |
removeAllPrivileges()
Remove all privileges. |
Role |
removePrivilege(Role.Privilege privilege)
Remove a privilege. |
(package private) Role |
setRoleLocation(java.lang.String loc)
Set the role location. |
Role |
setStudyIdentifier(java.lang.String studyIdentifier)
Set the study identifier. |
Role |
setStudyName(java.lang.String name)
Set the study name. |
Role |
setUserIdentifier(java.lang.String userIdentifier)
Set the user identifier. |
Role |
setUserName(java.lang.String name)
Set the user name. |
java.lang.String |
toString()
Return a string representation of this Role . |
(package private) java.lang.String |
toStringInternal(boolean showAll)
Return a string representation of this Role . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private java.lang.String roleLocation
private java.lang.String userIdentifier
private java.lang.String userName
private java.lang.String studyIdentifier
private java.lang.String studyName
private java.util.BitSet privilegeSet
Constructor Detail |
---|
public Role(java.lang.String userIdentifier, java.lang.String studyIdentifier)
Role
object with attributes
specified by the input parameters.
userIdentifier
- the user who has the role.studyIdentifier
- the study on which the user has the role.Method Detail |
---|
Role setRoleLocation(java.lang.String loc)
loc
- the location to assign to this role. May be null.
Role
.java.lang.String getRoleLocation()
public Role setUserIdentifier(java.lang.String userIdentifier)
userIdentifier
- the user identifier to assign to this role.
Role
.public java.lang.String getUserIdentifier()
public Role setUserName(java.lang.String name)
name
- the user name to assign to this role. May be null.
Role
.public java.lang.String getUserName()
public Role setStudyIdentifier(java.lang.String studyIdentifier)
studyIdentifier
- the study identifier to assign to this role.
Role
.public java.lang.String getStudyIdentifier()
public Role setStudyName(java.lang.String name)
name
- the name to assign to the study of this role.
May be null.
Role
.public java.lang.String getStudyName()
public Role addPrivilege(Role.Privilege privilege)
privilege
- is the privilege to grant.
role
.public Role removePrivilege(Role.Privilege privilege)
privilege
- is the privilege to remove.
Role
.public Role addAllPrivileges()
Role
.public Role removeAllPrivileges()
Role
.public boolean getPrivilege(Role.Privilege privilege)
privilege
- is the privilege to check for.
true
if privilege
is granted, false
otherwise.public java.lang.String toString()
Role
.
toString
in class java.lang.Object
Role
.java.lang.String toStringInternal(boolean showAll)
Role
.
showAll
- specifies if internal data members should be shown.
Role
.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |