Last change
on this file since 4423 was
4423,
checked in by cneumuel, 14 years ago
|
- Refactored HL.Hive.Experiment. JobItems are not called HiveJobs and OptimizerJobs do not contain a hierarchy anymore.
- Dynamic generation of jobs on a slave are not reflected on the client user interface.
- Optimizer-Trees are now strictly synchronized with the HiveJob-Trees (also the ComputeInParallel property is taken into account when the Child HiveJobs are created)
- Improved the way a class can report progress and lock the UI (IProgressReporter, IProgress, Progress, ProgressView)
- Changes were made to the config-files, so that server and clients work with blade12.hpc.fh-hagenberg.at
- Lots of small changes and bugfixes
|
File size:
1.3 KB
|
Line | |
---|
1 | using System;
|
---|
2 | using System.Collections.Generic;
|
---|
3 | using System.Linq;
|
---|
4 | using System.Text;
|
---|
5 | using System.Security.Principal;
|
---|
6 | using System.ServiceModel;
|
---|
7 | using System.Threading;
|
---|
8 | using System.Security;
|
---|
9 | using HeuristicLab.Hive.Server.DataAccess;
|
---|
10 | using HeuristicLab.Hive.Server.Core.InternalInterfaces;
|
---|
11 | using System.Web.Security;
|
---|
12 |
|
---|
13 | namespace HeuristicLab.Hive.Server.Core.Authorization {
|
---|
14 | public class AuthorizationManager : IAuthorizationManager {
|
---|
15 | private MembershipUser Identity {
|
---|
16 | get { return Membership.GetUser(); }
|
---|
17 | }
|
---|
18 |
|
---|
19 | public Guid UserId {
|
---|
20 | get { return (Guid)Identity.ProviderUserKey; }
|
---|
21 | }
|
---|
22 |
|
---|
23 | public void AuthorizeJobs(params Guid[] jobIds) {
|
---|
24 | if (!IsAuthorizedForJobs(jobIds)) {
|
---|
25 | throw new SecurityException("User '" + Identity.UserName + "' is not authorized to access job (Id: " + string.Join(", ", jobIds.Select(x => x.ToString()).ToArray()) + ")");
|
---|
26 | }
|
---|
27 | }
|
---|
28 |
|
---|
29 | private bool IsAuthorizedForJobs(params Guid[] jobIds) {
|
---|
30 | return DaoLocator.JobDao.IsUserAuthorizedForJobs(UserId, jobIds);
|
---|
31 | }
|
---|
32 |
|
---|
33 | public void Authorize(Guid userId) {
|
---|
34 | if (userId != this.UserId) {
|
---|
35 | throw new SecurityException("User '" + Identity.UserName + "' is not authorized to access object");
|
---|
36 | }
|
---|
37 | }
|
---|
38 | }
|
---|
39 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.