Ejemplo n.º 1
0
        internal static ObjectAcl ObjectGroupAcl(
            string groupName,
            string issuedByUserGuid,
            string bucketGuid,
            string objectGuid,
            bool permitRead,
            bool permitWrite,
            bool permitReadAcp,
            bool permitWriteAcp,
            bool fullControl)
        {
            if (String.IsNullOrEmpty(groupName))
            {
                throw new ArgumentNullException(nameof(groupName));
            }
            if (String.IsNullOrEmpty(issuedByUserGuid))
            {
                throw new ArgumentNullException(nameof(issuedByUserGuid));
            }
            if (String.IsNullOrEmpty(bucketGuid))
            {
                throw new ArgumentNullException(nameof(bucketGuid));
            }
            if (String.IsNullOrEmpty(objectGuid))
            {
                throw new ArgumentNullException(nameof(objectGuid));
            }

            ObjectAcl ret = new ObjectAcl();

            ret.UserGroup        = groupName;
            ret.UserGUID         = null;
            ret.IssuedByUserGUID = issuedByUserGuid;
            ret.BucketGUID       = bucketGuid;
            ret.ObjectGUID       = objectGuid;

            ret.PermitRead     = permitRead;
            ret.PermitWrite    = permitWrite;
            ret.PermitReadAcp  = permitReadAcp;
            ret.PermitWriteAcp = permitWriteAcp;
            ret.FullControl    = fullControl;

            return(ret);
        }
Ejemplo n.º 2
0
        internal void AddObjectAcl(ObjectAcl acl)
        {
            if (acl == null)
            {
                return;
            }

            Obj obj = GetObjectMetadataByGuid(acl.ObjectGUID);

            if (obj == null)
            {
                _Logging.Debug("SetAcl unable to find object GUID " + acl.ObjectGUID + " in bucket " + _Bucket.Name);
                return;
            }

            acl.BucketGUID = _Bucket.GUID;
            acl.ObjectGUID = obj.GUID;
            _ORM.Insert <ObjectAcl>(acl);
        }