コード例 #1
0
 /// <summary>
 /// Describes an object capable of managing <see cref="Process"/> and <see cref="ActorAction"/> resources.
 /// </summary>
 public ProcessFacade(ILogger <ProcessFacade> logger, IProcessStore processStore, IApprovalsLegacyStore approvalsLegacyStore, ISecurityStore securityStore)
 {
     _logger               = logger ?? throw new ArgumentNullException(nameof(logger));
     _processStore         = processStore ?? throw new ArgumentNullException(nameof(processStore));
     _approvalsLegacyStore = approvalsLegacyStore ?? throw new ArgumentNullException(nameof(approvalsLegacyStore));
     _securityStore        = securityStore ?? throw new ArgumentNullException(nameof(securityStore));
 }
コード例 #2
0
 /// <summary>
 /// Describes an object capable of managing <see cref="Activity"/> and <see cref="ActorAction"/> resources.
 /// </summary>
 public ActivityFacade(ILogger <ActivityFacade> logger, IActivityStore activityStore, IProcessStore processStore, IApprovalsLegacyStore approvalsLegacyStore, IPersonIdentificationStore personIdentificationStore, ISecurityStore securityStore)
 {
     _logger                    = logger ?? throw new ArgumentNullException(nameof(logger));
     _processStore              = processStore ?? throw new ArgumentNullException(nameof(processStore));
     _activityStore             = activityStore ?? throw new ArgumentNullException(nameof(activityStore));
     _approvalsLegacyStore      = approvalsLegacyStore ?? throw new ArgumentNullException(nameof(approvalsLegacyStore));
     _personIdentificationStore = personIdentificationStore ?? throw new ArgumentNullException(nameof(personIdentificationStore));
     _securityStore             = securityStore ?? throw new ArgumentNullException(nameof(securityStore));
 }
コード例 #3
0
        public static ISecurityIdentity AddSecurityIdentity(this ISecurityStore store, string id = null)
        {
            if (string.IsNullOrEmpty(id))
            {
                id = Guid.NewGuid().ToString();
            }
            SecurityStore    securityStore    = (SecurityStore)store;
            SecurityIdentity securityIdentity = new SecurityIdentity((SecurityStore)store, id);

            securityStore.SecurityIdentities.Add(securityIdentity);
            return(securityIdentity);
        }
コード例 #4
0
        public static ISecurityItem AddSecurityItem(this ISecurityStore store, string id = null)
        {
            SecurityStore securityStore = (SecurityStore)store;

            if (string.IsNullOrEmpty(id))
            {
                id = Guid.NewGuid().ToString();
            }
            SecurityItem securityItem = new SecurityItem((SecurityStore)store, id);

            securityStore.SecurityItems.Add(securityItem);
            return(securityItem);
        }
コード例 #5
0
        public static IAccessAuthorization AccessAuthorize(this ISecurityStore store, ISecurityIdentity securityIdentity, ISecurityItem securityItem, string id = null)
        {
            if (string.IsNullOrEmpty(id))
            {
                id = Guid.NewGuid().ToString();
            }
            SecurityStore       securityStore       = (SecurityStore)store;
            AccessAuthorization accessAuthorization = new AccessAuthorization((SecurityStore)store, id)
            {
                SecurityIdentity = securityIdentity, SecurityItem = securityItem
            };

            securityStore.Authorizations.Add(accessAuthorization);
            return(accessAuthorization);
        }