示例#1
0
        public bool CheckUserAccess(IUserRestriction restrictedElement)
        {
            if (!EnableRestrictionGroups || string.IsNullOrEmpty(restrictedElement.RestrictionGroup))
            {
                return(true);
            }

            foreach (var group in restrictedElement.RestrictionGroup.Split(new[] { "," }, StringSplitOptions.RemoveEmptyEntries))
            {
                if (RestrictionGroups.Contains(group))
                {
                    return(true);
                }
            }

            return(false);
        }
示例#2
0
        public void Clear()
        {
            Id          = Guid.Empty;
            TemplateId  = Guid.Empty;
            Name        = String.Empty;
            Password    = String.Empty;
            ProfileType = UserProfileType.UserProfile;
            LastLogin   = DateTime.MinValue;
            Image       = null;

            SelectedShares.Clear();

            RestrictAges            = false;
            RestrictShares          = false;
            EnableRestrictionGroups = false;
            RestrictionGroups.Clear();
            AllowedAge = 5;
            IncludeParentGuidedContent = false;
            IncludeUnratedContent      = false;
        }