Beispiel #1
0
 public QueuesController(IQueueBusiness queueBusiness,
                         IPermissionCheck permissionCheck,
                         ILogger <QueuesController> logger) :
     base(permissionCheck, logger)
 {
     this.queueBusiness = queueBusiness;
 }
Beispiel #2
0
 public UsersController(IUsersBusiness usersBusiness,
                        IPermissionCheck permissionCheck,
                        ILogger <UsersController> logger) :
     base(permissionCheck, logger)
 {
     this.usersBusiness = usersBusiness;
 }
 public ValuesChangingController(ITokenCheck tokenCheck, ISetPermissionsToRole setPermissionsToRole, ISetUserRoles setUserRoles, IPermissionCheck permissionCheck)
 {
     this.tokenCheck           = tokenCheck;
     this.setPermissionsToRole = setPermissionsToRole;
     this.setUserRoles         = setUserRoles;
     this.permissionCheck      = permissionCheck;
 }
Beispiel #4
0
 public AppsController(IAppsBusiness appsBusiness,
                       IPermissionCheck permissionCheck,
                       ILogger <AppsController> logger) :
     base(permissionCheck, logger)
 {
     this.appsBusiness = appsBusiness;
 }
Beispiel #5
0
 public InvitesController(SSOContext context, ITokenCheck tokenCheck, IPermissionCheck permissionCheck, IHttpClientFactory httpClientFactory)
 {
     _context               = context;
     this.tokenCheck        = tokenCheck;
     this.permissionCheck   = permissionCheck;
     this.httpClientFactory = httpClientFactory;
 }
        /// <summary>
        /// Run a permission check and return error if it failed
        /// </summary>
        /// <param name="permCheck"></param>
        /// <param name="grants"></param>
        /// <param name="exception"></param>
        /// <returns></returns>
        public static bool Ensure(this IPermissionCheck permCheck, List <Grants> grants, out HttpResponseException exception)
        {
            var wrapLog = permCheck.Log.Call("Ensure", () => $"[{string.Join(",", grants)}]", () => "or throw");
            var ok      = permCheck.UserMay(grants);

            exception = ok ? null : Http.PermissionDenied("required permissions for this request are not given");
            wrapLog(ok ? "ok" : "permissions not ok");
            return(ok);
        }
 public GenericPermissionCheckCommandHandlerDecorator(ICommandHandler <TCommand> wrappedHandler, IIdentity currentUser, IPermissionCheck <TCommand> check)
 {
     this.wrappedHandler = wrappedHandler ?? throw new ArgumentNullException(nameof(wrappedHandler));
     this.currentUser    = currentUser;
     this.check          = check ?? throw new ArgumentNullException(nameof(check));
 }
 public UserParametersController(ITokenCheck tokenCheck, IPermissionCheck permissionCheck)
 {
     this.tokenCheck      = tokenCheck;
     this.permissionCheck = permissionCheck;
 }
Beispiel #9
0
 public RolesController(ITokenCheck tokenCheck, IPermissionCheck permissionCheck)
 {
     this.tokenCheck      = tokenCheck;
     this.permissionCheck = permissionCheck;
 }
Beispiel #10
0
 protected ControllerBase(IPermissionCheck permissionCheck,
                          ILogger <T> logger)
 {
     this.permissionCheck = permissionCheck;
     this.logger          = logger;
 }
Beispiel #11
0
 public CompanyAirportsController(SSOContext context, ITokenCheck tokenCheck, IPermissionCheck permissionCheck)
 {
     _context             = context;
     this.tokenCheck      = tokenCheck;
     this.permissionCheck = permissionCheck;
 }
Beispiel #12
0
 public InviteRolesController(SSOContext context, ITokenCheck tokenCheck, IPermissionCheck permissionCheck)
 {
     _context             = context;
     this.tokenCheck      = tokenCheck;
     this.permissionCheck = permissionCheck;
 }