Beispiel #1
0
        public override bool UserHasGroupPermission(AdobeConnectProvider provider, UserInfo user)
        {
            if (UserIsSpecialACGroupParticipant(provider, user, PrincipalType.admins))
            {
                return(true);
            }

            if (string.IsNullOrEmpty(ConfigurationManager.AppSettings["MonitoringGroups"]))
            {
                return(false);
            }

            string[] configGroups = ConfigurationManager.AppSettings["MonitoringGroups"].Split(',', ';');
            var      groups       = provider.GetGroupsByType(PrincipalType.group);

            if (groups?.Values != null)
            {
                var filteredGroups = groups.Values.Where(x => configGroups.Any(tg => tg.Trim() == x.Name));
                foreach (var groupPrincipal in filteredGroups)
                {
                    if (UserIsGroupParticipant(provider, user, groupPrincipal))
                    {
                        return(true);
                    }
                }
            }

            return(false);
        }
Beispiel #2
0
        public override bool UserHasGroupPermission(AdobeConnectProvider provider, UserInfo user)
        {
            if (UserIsSpecialACGroupParticipant(provider, user, PrincipalType.admins))
            {
                return(true);
            }

            if (!_configGroups.Any())
            {
                return(false);
            }

            var groups = provider.GetGroupsByType(PrincipalType.group);

            if (groups?.Values != null)
            {
                var filteredGroups = groups.Values.Where(x => _configGroups.Any(tg => tg.Trim() == x.Name));
                foreach (var groupPrincipal in filteredGroups)
                {
                    if (UserIsGroupParticipant(provider, user, groupPrincipal))
                    {
                        return(true);
                    }
                }
            }

            return(false);
        }
Beispiel #3
0
        protected bool UserIsSpecialACGroupParticipant(AdobeConnectProvider provider, UserInfo user, PrincipalType groupType)
        {
            var group = provider.GetGroupsByType(groupType);

            if (group.Status.Code != StatusCodes.ok)
            {
                return(false);
            }

            return(UserIsGroupParticipant(provider, user, group.Values.First()));
        }