Package com.collabnet.ce.webservices
Class CTFRole
- java.lang.Object
-
- com.collabnet.ce.webservices.CTFRole
-
- All Implemented Interfaces:
ObjectWithTitle
public class CTFRole extends Object implements ObjectWithTitle
A role in CTF belongs to a project.- Author:
- Kohsuke Kawaguchi
-
-
Field Summary
Fields Modifier and Type Field Description protected CollabNetApp
app
protected String
id
-
Constructor Summary
Constructors Constructor Description CTFRole(CTFProject parent, org.json.simple.JSONObject data)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected <T extends ObjectWithTitle>
TfindByTitle(List<T> list, String title)
Convenience method for a subtype to find an item in a collection by its title.String
getDescription()
String
getId()
CTFList<CTFUser>
getMembers()
Gets the users who has this role (in the project that the role belongs to.)String
getTitle()
void
grant(CTFUser u)
void
grant(String username)
Grants this role to the given user.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.collabnet.ce.webservices.ObjectWithTitle
getId
-
-
-
-
Field Detail
-
app
protected final CollabNetApp app
-
id
protected final String id
-
-
Constructor Detail
-
CTFRole
public CTFRole(CTFProject parent, org.json.simple.JSONObject data)
-
-
Method Detail
-
getTitle
public String getTitle()
- Specified by:
getTitle
in interfaceObjectWithTitle
-
getDescription
public String getDescription()
-
getMembers
public CTFList<CTFUser> getMembers() throws IOException
Gets the users who has this role (in the project that the role belongs to.)- Throws:
IOException
-
grant
public void grant(String username) throws IOException
Grants this role to the given user.- Throws:
IOException
-
grant
public void grant(CTFUser u) throws IOException
- Throws:
IOException
-
getId
public String getId()
-
findByTitle
protected <T extends ObjectWithTitle> T findByTitle(List<T> list, String title)
Convenience method for a subtype to find an item in a collection by its title.
-
-