Example #1
0
        public ObjectAclBuilder AddGroup(PredefinedGroup group, ObjectPermissions permissions)
        {
            if (permissions.HasAnyFlags(ObjectPermissions.Read))
            {
                ReadObject.AddGroup(group);
            }

            if (permissions.HasAnyFlags(ObjectPermissions.ReadAcl))
            {
                ReadAcl.AddGroup(group);
            }

            if (permissions.HasAnyFlags(ObjectPermissions.WriteAcl))
            {
                WriteAcl.AddGroup(group);
            }

            if (permissions.HasAnyFlags(ObjectPermissions.FullControl))
            {
                FullControl.AddGroup(group);
            }

            return(this);
        }
Example #2
0
        public ObjectAclBuilder AddEmail(string email, ObjectPermissions permissions)
        {
            if (permissions.HasAnyFlags(ObjectPermissions.Read))
            {
                ReadObject.AddEmail(email);
            }

            if (permissions.HasAnyFlags(ObjectPermissions.ReadAcl))
            {
                ReadAcl.AddEmail(email);
            }

            if (permissions.HasAnyFlags(ObjectPermissions.WriteAcl))
            {
                WriteAcl.AddEmail(email);
            }

            if (permissions.HasAnyFlags(ObjectPermissions.FullControl))
            {
                FullControl.AddEmail(email);
            }

            return(this);
        }
Example #3
0
        public ObjectAclBuilder AddGroup(string uri, ObjectPermissions permissions)
        {
            if (permissions.HasAnyFlags(ObjectPermissions.Read))
            {
                ReadObject.AddGroup(uri);
            }

            if (permissions.HasAnyFlags(ObjectPermissions.ReadAcl))
            {
                ReadAcl.AddGroup(uri);
            }

            if (permissions.HasAnyFlags(ObjectPermissions.WriteAcl))
            {
                WriteAcl.AddGroup(uri);
            }

            if (permissions.HasAnyFlags(ObjectPermissions.FullControl))
            {
                FullControl.AddGroup(uri);
            }

            return(this);
        }
Example #4
0
    public ObjectAclBuilder AddUserId(string userId, ObjectPermissions permissions)
    {
        if (permissions.HasFlag(ObjectPermissions.Read))
        {
            ReadObject.AddUserId(userId);
        }

        if (permissions.HasFlag(ObjectPermissions.ReadAcl))
        {
            ReadAcl.AddUserId(userId);
        }

        if (permissions.HasFlag(ObjectPermissions.WriteAcl))
        {
            WriteAcl.AddUserId(userId);
        }

        if (permissions.HasFlag(ObjectPermissions.FullControl))
        {
            FullControl.AddUserId(userId);
        }

        return(this);
    }