org.eclipse.emf.emfstore.server.auth
Interface ESAuthorizationService

All Known Implementing Classes:
DefaultESAuthorizationService

public interface ESAuthorizationService

Since:
1.5
Author:
emueller

Method Summary
 void checkAccess(ESMethodInvocation method)
          Checks whether a given operation may be executed.
 boolean checkProjectAdminAccess(ESSessionId sessionId, ESGlobalProjectId projectId)
          Check if the session is valid for admin access to the given project.
 boolean checkProjectAdminAccess(ESSessionId sessionId, ESGlobalProjectId projectId, ESProjectAdminPrivileges privileg)
          Check if the session is valid for admin access to the given project.
 boolean checkProjectAdminAccessForOrgUnit(ESSessionId sessionId, ESOrgUnitId orgUnitId)
          Check if the session is valid for admin access to the given organizational unit.
 boolean checkProjectAdminAccessForOrgUnit(ESSessionId sessionId, ESOrgUnitId orgUnitId, Set<ESGlobalProjectId> projectIds)
          Check if the session is valid for admin access to the given organizational unit.
 void checkReadAccess(ESSessionId sessionId, ESGlobalProjectId projectId, Set<org.eclipse.emf.ecore.EObject> modelElements)
          Check if the session may read the given model elements in the project.
 void checkServerAdminAccess(ESSessionId sessionId)
          Check if the session is valid for server admin access.
 void checkWriteAccess(ESSessionId sessionId, ESGlobalProjectId projectId, Set<org.eclipse.emf.ecore.EObject> modelElements)
          Check if the session may write the given model elements in the project.
 void init(ESSessions sessions, ESOrgUnitResolver orgUnitResolverServive, ESOrgUnitProvider orgUnitProvider)
          Initializes this service.
 

Method Detail

checkProjectAdminAccess

boolean checkProjectAdminAccess(ESSessionId sessionId,
                                ESGlobalProjectId projectId,
                                ESProjectAdminPrivileges privileg)
                                throws AccessControlException
Check if the session is valid for admin access to the given project.

Parameters:
sessionId - the session id
projectId - the project id. May be null
privileg - the ESProjectAdminPrivileges to be checked
Returns:
true, if permission is granted via the server admin role, false otherwise
Throws:
AccessControlException - if the session is invalid for admin access

checkProjectAdminAccessForOrgUnit

boolean checkProjectAdminAccessForOrgUnit(ESSessionId sessionId,
                                          ESOrgUnitId orgUnitId)
                                          throws AccessControlException
Check if the session is valid for admin access to the given organizational unit.

Parameters:
sessionId - the session id
orgUnitId - the ID of an organizational unit
Returns:
true, if permission is granted via the server admin role, false otherwise
Throws:
AccessControlException - if the session is invalid for admin access

checkProjectAdminAccessForOrgUnit

boolean checkProjectAdminAccessForOrgUnit(ESSessionId sessionId,
                                          ESOrgUnitId orgUnitId,
                                          Set<ESGlobalProjectId> projectIds)
                                          throws AccessControlException
Check if the session is valid for admin access to the given organizational unit.

Parameters:
sessionId - the session id
orgUnitId - the ID of an organizational unit
projectIds - the set of ESGlobalProjectIds for which to check access for
Returns:
true, if permission is granted via the server admin role, false otherwise
Throws:
AccessControlException - if the session is invalid for admin access

checkProjectAdminAccess

boolean checkProjectAdminAccess(ESSessionId sessionId,
                                ESGlobalProjectId projectId)
                                throws AccessControlException
Check if the session is valid for admin access to the given project.

Parameters:
sessionId - the session id
projectId - the project id. May be null
Returns:
true, if permission is granted via the server admin role, false otherwise
Throws:
AccessControlException - if the session is invalid for admin access

checkServerAdminAccess

void checkServerAdminAccess(ESSessionId sessionId)
                            throws AccessControlException
Check if the session is valid for server admin access.

Parameters:
sessionId - the session id
Throws:
AccessControlException - if the session is invalid for server admin access

checkReadAccess

void checkReadAccess(ESSessionId sessionId,
                     ESGlobalProjectId projectId,
                     Set<org.eclipse.emf.ecore.EObject> modelElements)
                     throws AccessControlException
Check if the session may read the given model elements in the project.

Parameters:
sessionId - session id
projectId - project id
modelElements - a set of model elements
Throws:
AccessControlException - if the session may not read any of the model elements

checkWriteAccess

void checkWriteAccess(ESSessionId sessionId,
                      ESGlobalProjectId projectId,
                      Set<org.eclipse.emf.ecore.EObject> modelElements)
                      throws AccessControlException
Check if the session may write the given model elements in the project.

Parameters:
sessionId - session id
projectId - project id
modelElements - a set of model elements
Throws:
AccessControlException - if the session may not write any of the model elements

checkAccess

void checkAccess(ESMethodInvocation method)
                 throws AccessControlException
Checks whether a given operation may be executed.

Parameters:
method - the method the user intends to execute
Throws:
AccessControlException - in case access is denied

init

void init(ESSessions sessions,
          ESOrgUnitResolver orgUnitResolverServive,
          ESOrgUnitProvider orgUnitProvider)
Initializes this service.

Parameters:
sessions - the ESSessions object for session handling
orgUnitResolverServive - the ESOrgUnitResolver for resolving organizational units
orgUnitProvider - the ESOrgUnitProvider for obtaining organizational units


Copyright © 2016. All Rights Reserved.