示例#1
0
        public async Task Security_GetPrivilegesAsync(PrincipalTypes principalType)
        {
            var results = await _client.Security_GetPrivilegesAsync(1, principalType).ConfigureAwait(false);

            Assert.NotNull(results);
            Assert.NotEmpty(results);
        }
        /// <summary>
        /// Gets a list of privileges assigned in the system
        /// </summary>
        public async Task <IEnumerable <PrivilegesExtended> > Security_GetPrivilegesAsync(
            int userDirectory_Id,
            PrincipalTypes principalType_Code)
        {
            var queryParamValues = QueryParamValues.From(
                new NamedValue(nameof(userDirectory_Id).Capitalize(), userDirectory_Id),
                new NamedValue(nameof(principalType_Code).Capitalize(), StringExtensions.FromPrincipalType(principalType_Code))
                );

            return(await ExecuteNativeApiMethodAsync <IEnumerable <PrivilegesExtended> >(nameof(Security_GetPrivilegesAsync).WithoutAsyncSuffix(), queryParamValues).ConfigureAwait(false));
        }
 public static string FromPrincipalType(PrincipalTypes principalType) => principalType == PrincipalTypes.User ? "U" : "G";