Exemple #1
0
        public string GetGroupId(AadGroups group)
        {
            if (this.groupIds == null)
            {
                ServiceSettingsDictionary settings = this.settingsProvider.GetServiceSettings();
                this.groupIds = new Dictionary <AadGroups, string>();

                string storeAssociateId = ReadSetting(settings, "AadSalesAssociateGroupObjectId");
                this.groupIds.Add(AadGroups.StoreAssociate, storeAssociateId);
                string fieldMangerGroupId = ReadSetting(settings, "AadFieldManagerGroupObjectId");
                this.groupIds.Add(AadGroups.FieldManager, fieldMangerGroupId);
                string fieldAgentGroupId = ReadSetting(settings, "AadFieldAgentGroupObjectId");
                this.groupIds.Add(AadGroups.FieldAgent, fieldAgentGroupId);
            }

            string groupId;

            return(this.groupIds.TryGetValue(group, out groupId) ? groupId : null);
        }
 public AuthorizeAadGroupAttribute(AadGroups group)
 {
     this.Group = group;
 }