コード例 #1
0
        private async Task grantUserAccess(IHubActionTester tester, AppUser user)
        {
            var app = await tester.HubApp();

            var editUserRole = await app.Role(HubInfo.Roles.EditUser);

            var hubAppModifier = await tester.HubAppModifier();

            await user.AddRole(editUserRole, hubAppModifier);
        }
コード例 #2
0
        private async Task <int> assignRole(IHubActionTester tester, AppUser user, AppRole role)
        {
            var assignRoleTester = tester.Create(hubApi => hubApi.AppUserMaintenance.AssignRole);
            var adminUser        = await assignRoleTester.AdminUser();

            var hubAppModifier = await tester.HubAppModifier();

            var userRoleID = await assignRoleTester.Execute(new UserRoleRequest
            {
                UserID = user.ID.Value,
                RoleID = role.ID.Value
            }, adminUser, hubAppModifier.ModKey());

            return(userRoleID);
        }