public EntityFrameworkCore.Data.Role CreateRole(AuthorizationsTestContext context, string roleName) { var role = new EntityFrameworkCore.Data.Role { Name = roleName, CreationBy = context.CurrentUserId, ModificationBy = context.CurrentUserId }; context.Roles().Add(role); return(role); }
protected EntityFrameworkCore.Data.Authorization CreateAuthorization(AuthorizationsTestContext context, Guid principalId, EntityFrameworkCore.Data.Role role, EntityFrameworkCore.Data.Scope scope) { var authorization = new EntityFrameworkCore.Data.Authorization { PrincipalId = principalId, Role = role, Scope = scope, CreationBy = context.CurrentUserId, ModificationBy = context.CurrentUserId }; context.Authorizations().Add(authorization); return(authorization); }
protected EntityFrameworkCore.Data.RoleRight AddRightToRole(AuthorizationsTestContext context, EntityFrameworkCore.Data.Right right, EntityFrameworkCore.Data.Role role) { var roleRight = new EntityFrameworkCore.Data.RoleRight { Right = right, Role = role }; context.RoleRights().Add(roleRight); return(roleRight); }