コード例 #1
0
        /// <summary>
        /// Updates the access levels for this directory.
        /// </summary>
        /// <returns>A pointer to <c>this</c>.</returns>
        /// <param name="acl">The new access level for the directory.</param>
        public DataDirectory updatePermissions(ReadDataAcl acl)
        {
            var resAndData = client.patchJsonHelper(url, new UpdateDataDirectory(acl.getAclStrings()));

            Client.checkResult(resAndData, "Error setting data directory permissions", true);
            return(this);
        }
コード例 #2
0
        /// <summary>
        /// Create the directory with the correct access modifiers.
        /// </summary>
        /// <returns>A pointer to <c>this</c>.</returns>
        /// <param name="acl">The access level for the directory.</param>
        public DataDirectory create(ReadDataAcl acl = null)
        {
            var aclList    = acl?.getAclStrings();
            var resAndData = client.postJsonHelper(
                DataUtilities.getDataUrl(parent), new CreateDataDirectory(name, aclList), null);

            Client.checkResult(resAndData, "Error creating data directory", true);
            return(this);
        }
コード例 #3
0
        /// <summary>
        /// Gets the access levels for this directory.
        /// </summary>
        /// <returns>The access control levels for this directory.</returns>
        public ReadDataAcl getPermissions()
        {
            var resAndData = client.getHelper(url, new Dictionary <string, string> {
                { "acl", "true" }
            });

            Client.checkResult(resAndData, "Error getting data directory permissions", true);
            var result = JsonConvert.DeserializeObject <DataResponse>(Client.DEFAULT_ENCODING.GetString(resAndData.result));

            return(ReadDataAcl.fromAclStrings(result.acl.read));
        }