public class TextGridProject extends AbstractResource implements IAdaptable, ITextGridPermission
Modifier and Type | Field and Description |
---|---|
static String |
TG_STANDARD_ROLE_ADMINISTRATOR |
static String |
TG_STANDARD_ROLE_EDITOR |
static String |
TG_STANDARD_ROLE_PROJECTLEADER |
static String |
TG_STANDARD_ROLE_WATCHER |
Modifier | Constructor and Description |
---|---|
protected |
TextGridProject(info.textgrid.namespaces.middleware.tgauth.ProjectInfo pi)
called by
createNewProject(String, String) after asking RBAC to
create the project |
protected |
TextGridProject(String id)
Protected constructor that reads project with the given ID from RBAC.
|
Modifier and Type | Method and Description |
---|---|
boolean |
activateRoleInSession(String ePPN,
String Role) |
static void |
addListener(ITextGridProjectListener listener)
Adds a listener for project change events.
|
Boolean |
addMultiRolesToMember(String ePPN,
String[] Roles) |
Boolean |
addRoleMember(String ePPN,
String Role)
Enters a Role for the User identified by ePPN into RBAC.
|
static boolean |
checkForRole(String projectID,
String roleToCheck)
Checks whether the logged-in user has this role in this project, e.g.
|
static TextGridProject |
createNewProject(String name,
String description) |
Boolean |
deleteRole(String eppn,
String role)
Deletes a Role from RBAC.
|
static info.textgrid.namespaces.middleware.tgauth.PortTgextra |
ensureStubIsLoaded()
Deprecated.
|
boolean |
equals(Object obj) |
static String[] |
filterRolesByProject(info.textgrid.namespaces.middleware.tgauth.RolesetResponse roleset,
String projectID)
Takes a rolesetResponse (from tgAssignedRoles, which returns ALL Roles in
any project the authenticated user is Projektleiter in) and splits the
rolesetResponse (Array of Strings like
"Administrator,TGPR3,Projekt-Teilnehmer") and returns only the roles a
user has in the specified project.
|
static String |
findLabelForRBACRole(String role)
Returns a Language-specific Label of the Role String as used by RBAC.
|
Object |
getAdapter(Class adapter) |
String[] |
getAvailableRoles()
returns available Roles for this project, currently a fixed hard-wired
set for any project.
|
String |
getDescription() |
String |
getId() |
ArrayList<String> |
getLeaders() |
String |
getName() |
int |
getPermissions()
Return the user's permissions on the current resource.
|
String |
getProjectfile()
Returns the ProjectFile URI (as String) for this Project
|
info.textgrid.namespaces.middleware.tgauth.ProjectInfo |
getProjectInfo() |
static TextGridProject |
getProjectInstance(info.textgrid.namespaces.middleware.tgauth.ProjectInfo pi)
Constructor for TextGridProjcts that know their ProjectInfo.
|
static TextGridProject |
getProjectInstance(String id) |
static info.textgrid.namespaces.middleware.tgauth.PortTgextra |
getStub() |
ArrayList<UserRole2> |
getUserRoles2FromRBAC(IProgressMonitor monitor)
returns a UserRole list.
|
ArrayList<UserRole2> |
getUserRoles2Offline()
Returns cached User-Role Assigment without net access.
|
int |
hashCode() |
boolean |
iAmLeader()
Checks whether the logged-in user has the Projektleiter role.
|
static void |
notifyListeners(ITextGridProjectListener.Event event,
TextGridProject textGridProject)
THIS IS NOT API, it may only be called from the model or
EFS implementation.
|
static void |
removeListener(ITextGridProjectListener listener)
Removes a listener for project change events.
|
void |
reset() |
boolean |
setProjectfile(String PfURI)
Accesses the RBAC to register a Projectfile URI as string with this
project.
|
String |
toString() |
void |
unsetProjectFile()
Unregister the projectFile.
|
assertPermission, getNumericPermission, hasPermissions, retrievePermissions
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
assertPermission, hasPermissions
public static final String TG_STANDARD_ROLE_PROJECTLEADER
public static final String TG_STANDARD_ROLE_ADMINISTRATOR
public static final String TG_STANDARD_ROLE_EDITOR
public static final String TG_STANDARD_ROLE_WATCHER
protected TextGridProject(String id) throws ProjectDoesNotExistException, RBACServiceException
getProjectInstance(String)
.id
- the ID of an (hopefully) existing project.ProjectDoesNotExistException
- if the project does not exist.RBACServiceException
- if some error occured while communicating with the backendprotected TextGridProject(info.textgrid.namespaces.middleware.tgauth.ProjectInfo pi) throws NullPointerException
createNewProject(String, String)
after asking RBAC to
create the project
clients MUST NOT call this constructor, but use
createNewProject(String, String)
instead.
pi
- NullPointerException
public void reset()
@Deprecated public static info.textgrid.namespaces.middleware.tgauth.PortTgextra ensureStubIsLoaded()
public static info.textgrid.namespaces.middleware.tgauth.PortTgextra getStub()
public static TextGridProject createNewProject(String name, String description) throws RemoteException
RemoteException
public static TextGridProject getProjectInstance(String id) throws RemoteException, ProjectDoesNotExistException, CrudServiceException
public static TextGridProject getProjectInstance(info.textgrid.namespaces.middleware.tgauth.ProjectInfo pi) throws RemoteException, NullPointerException
pi
- a valid project info record. Must not be null
.TextGridProject
, either an existing one from the
registry or a new one retrieved from the repo.RemoteException
NullPointerException
public info.textgrid.namespaces.middleware.tgauth.ProjectInfo getProjectInfo()
public String getId()
public String getName()
public String getDescription()
public String getProjectfile()
public boolean setProjectfile(String PfURI) throws OfflineException, RemoteException, info.textgrid.namespaces.middleware.tgauth.AuthenticationFault
PfURI
- OfflineException
RemoteException
info.textgrid.namespaces.middleware.tgauth.AuthenticationFault
public void unsetProjectFile() throws OfflineException, RemoteException, info.textgrid.namespaces.middleware.tgauth.AuthenticationFault
OfflineException
RemoteException
info.textgrid.namespaces.middleware.tgauth.AuthenticationFault
public int getPermissions() throws CoreException
ITextGridPermission
getPermissions
in interface ITextGridPermission
CoreException
- with further details when something goes wrong determining
the permissions. FIXME: This is subject to TG-23 refactoring.public Object getAdapter(Class adapter)
getAdapter
in interface IAdaptable
getAdapter
in class PlatformObject
public Boolean addMultiRolesToMember(String ePPN, String[] Roles) throws RemoteException, info.textgrid.namespaces.middleware.tgauth.RbacFault
RemoteException
info.textgrid.namespaces.middleware.tgauth.RbacFault
public Boolean addRoleMember(String ePPN, String Role) throws RemoteException, info.textgrid.namespaces.middleware.tgauth.RbacFault
ePPN
- Role
- projectID
- RemoteException
info.textgrid.namespaces.middleware.tgauth.RbacFault
public boolean activateRoleInSession(String ePPN, String Role) throws RemoteException
RemoteException
public Boolean deleteRole(String eppn, String role)
user
- role
- public String[] getAvailableRoles()
projectId
- public ArrayList<UserRole2> getUserRoles2Offline()
getUserRolesFromRBAC
public ArrayList<UserRole2> getUserRoles2FromRBAC(IProgressMonitor monitor)
public static String[] filterRolesByProject(info.textgrid.namespaces.middleware.tgauth.RolesetResponse roleset, String projectID)
roleset
- projectID
- public boolean iAmLeader()
public static boolean checkForRole(String projectID, String roleToCheck)
projectID
- roleToCheck
- public static String findLabelForRBACRole(String role)
role
- public static void addListener(ITextGridProjectListener listener)
listener
- public static void removeListener(ITextGridProjectListener listener)
listener
- public static void notifyListeners(ITextGridProjectListener.Event event, TextGridProject textGridProject)
event
- textGridProject
-