Ejemplo n.º 1
0
        public void RegisterPermissionDescriptorShouldWork()
        {
            var currentUserPermissionService = new Mock <ICurrentUserPermissionService>();
            var accessControlManager         = new AccessControlManager(currentUserPermissionService.Object);
            var permissionDescriptor         = new PermissionDescriptor();

            accessControlManager.RegisterPermissionDescriptor(permissionDescriptor);
        }
Ejemplo n.º 2
0
        private void EvaluateEmergencyAccessClaims()
        {
            _canExecuteExerciseEmergencyAccess = AccessControlManager.CanAccess(new ResourceRequest {
                GetType().FullName
            });
            (ExerciseEmergencyAccessCommand as VirtualDelegateCommand).RaiseCanExecuteChanged();

            EmergencyAccessEnabled = _currentUserPermissionService.DoesUserHavePermission(InfrastructurePermission.EmergencyAccessPermission);
        }
Ejemplo n.º 3
0
        public static IAccessControlManager SignInForTesting()
        {
            var accessControlManager = new AccessControlManager(Application.EveryDollar, ApiEnvironment.Production);
            var task = Task.Run(async()
                                => await SignIn(new RestClient("https://api.everydollar.com/"), accessControlManager));

            task.Wait();
            return(accessControlManager);
        }
Ejemplo n.º 4
0
 private void CheckRemAccess()
 {
     if (AccessControlManager == null && HtmlPage.IsEnabled)
     {
         throw new InvalidOperationException("A secure control requires the AccessControlManager properyt to be set.");
     }
     if (AccessControlManager != null && !AccessControlManager.CanAccess(_resourceRequest))
     {
         Visibility      = Visibility.Collapsed;
         base.Visibility = Visibility;
         CanAccess       = false;
     }
     else if (Visibility == Visibility.Collapsed)
     {
         Visibility      = Visibility.Visible;
         base.Visibility = Visibility;
         CanAccess       = true;
     }
 }