Ejemplo n.º 1
0
        public static User GetObject(Setting setting, HttpRequest request, OaUser oaUser)
        {
            var oaTenant    = Oa.GetResource <OaTenant>(setting, request, oaUser.TenantLink.ApsLink.Id);
            var oaAdminUser = Oa.GetResource <OaAdminUser>(setting, request, oaUser.AdminUserLink.ApsLink.Id);

            return(new User
            {
                ApsId = oaUser.AdminUserLink.ApsLink.Id,
                UserId = oaUser.UserId,
                Email = oaAdminUser.Email,
                Tenant = Tenant.GetObject(setting, request, oaTenant)
            });
        }
        public override void OnActionExecuting(ActionExecutingContext context)
        {
            var controllerActionDescriptor = context.ActionDescriptor as ControllerActionDescriptor;

            if (controllerActionDescriptor != null && controllerActionDescriptor.MethodInfo
                .GetCustomAttributes <AllowAnonimousAttribute>().Any())
            {
                // do not validate actions with 'AllowAnonimousAttribute'
                return;
            }

            Oa.ValidateRequest(_config, context);

            base.OnActionExecuting(context);
        }
Ejemplo n.º 3
0
        public static Tenant GetObject(Setting setting, HttpRequest request, OaTenant oaTenant)
        {
            var oaApplication = Oa.GetResource <OaApplication>(setting, request, oaTenant.AppLink.ApsLink.Id);
            var oaAccount     = Oa.GetResource <OaAccount>(setting, request, oaTenant.AccountLink.ApsLink.Id);

            return(new Tenant
            {
                Id = oaTenant.Aps.Id,
                CompanyName = oaAccount.CompanyName,
                App = Application.GetObject(oaApplication),

                // resources
                UsersLimit = oaTenant.UsersLimit.Limit,
                DiskspaceLimit = oaTenant.DiskspaceLimit.Limit,
                DevicesLimit = oaTenant.DevicesLimit.Limit
            });
        }
Ejemplo n.º 4
0
        public static Tenant GetObject(Setting setting, HttpRequest request, string oaTenantId)
        {
            var oaTenant = Oa.GetResource <OaTenant>(setting, request, oaTenantId);

            return(GetObject(setting, request, oaTenant));
        }
Ejemplo n.º 5
0
        public static User GetObject(Setting setting, HttpRequest request, string oaUserId)
        {
            var oaUser = Oa.GetResource <OaUser>(setting, request, oaUserId);

            return(GetObject(setting, request, oaUser));
        }