- Timestamp:
- 02/02/18 20:19:43 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HiveProjectManagement/HeuristicLab.Services.Hive/3.3/Manager/AuthorizationManager.cs
r15628 r15715 37 37 private const string NOT_AUTHORIZED_USERJOB = "Current user is not authorized to access the requested job"; 38 38 private const string NOT_AUTHORIZED_PROJECTRESOURCE = "Selected project is not authorized to access the requested resource"; 39 private const string USER_NOT_IDENTIFIED = "User could not be identified"; 40 private const string TASK_NOT_EXISTENT = "Queried task could not be found"; 39 41 40 42 private IPersistenceManager PersistenceManager { … … 61 63 pm.UseTransaction(() => { 62 64 var task = taskDao.GetById(taskId); 63 if (task == null) throw new SecurityException( NOT_AUTHORIZED_USERRESOURCE);65 if (task == null) throw new SecurityException(TASK_NOT_EXISTENT); 64 66 AuthorizeJob(pm, task.JobId, requiredPermission); 65 67 }); … … 151 153 // note: administrators and project owner are NOT automatically granted 152 154 public void AuthorizeUserForProjectUse(Guid userId, Guid projectId) { 153 if (userId == null || projectId == null) return; 155 if(userId == null || userId == Guid.Empty) { 156 throw new SecurityException(USER_NOT_IDENTIFIED); 157 } 158 if(projectId == null) return; 159 154 160 var pm = PersistenceManager; 155 161 // collect current and group membership Ids
Note: See TracChangeset
for help on using the changeset viewer.