public GuildsController( IPublishEndpoint publishEndpoint, IMapper mapper, ISendEndpointProvider sendEndpointProvider, StrifeDbContext dbContext ) { _mapper = mapper; _publishEndpoint = publishEndpoint; _sendEndpointProvider = sendEndpointProvider; _dbContext = dbContext; }
public MessagesController( IAuthorizationService authorizationService, IPublishEndpoint publishEndpoint, IMapper mapper, ISendEndpointProvider sendEndpointProvider, StrifeDbContext dbContext ) { _authorizationService = authorizationService; _mapper = mapper; _publishEndpoint = publishEndpoint; _sendEndpointProvider = sendEndpointProvider; _dbContext = dbContext; }
public static async Task <List <IdentityRoleClaim <Guid> > > GetClaimsAsync(this StrifeDbContext dbContext, Guid guildId, Guid userId) { // First we get all the user role joins for the user var userRoles = await dbContext.UserRoles.Where(ur => ur.UserId == userId).Select(ur => ur.RoleId) .ToListAsync(); // Then we get the role and filter to only include for the project var roles = await dbContext.Roles .Where(r => userRoles.Contains(r.Id) && r.GuildId == guildId).Select(r => r.Id).ToListAsync(); // Get all the role claims return(await dbContext.RoleClaims .Where(r => r.ClaimType == Permission.ClaimType && roles.Contains(r.RoleId)).ToListAsync()); }
public ChannelsController( IAuthorizationService authorizationService, UserManager <StrifeUser> userManager, StrifeDbContext dbContext, IPublishEndpoint publishEndpoint, ISendEndpointProvider sendEndpointProvider, IMapper mapper ) { _authorizationService = authorizationService; _publishEndpoint = publishEndpoint; _sendEndpointProvider = sendEndpointProvider; _userManager = userManager; _dbContext = dbContext; _mapper = mapper; }
public AddRoleUserConsumer(StrifeDbContext dbContext) { _dbContext = dbContext; }
public CreatePermissionsConsumer(StrifeDbContext dbContext) { _dbContext = dbContext; }
public CreateMessageConsumer(StrifeDbContext dbContext) { _dbContext = dbContext; }
public UsersController(StrifeDbContext dbContext, IMapper mapper, IAuthorizationService authorizationService) { _dbContext = dbContext; _mapper = mapper; _authorizationService = authorizationService; }
public PermissionAuthorizationHandler(StrifeDbContext dbContext) { _dbContext = dbContext; }
public CreateGuildConsumer(StrifeDbContext dbContext) { _dbContext = dbContext; }
public CreateChannelConsumer(StrifeDbContext dbContext) { _dbContext = dbContext; }