bool IsGranted(IState state) {
     if (!((IRoleTypeProvider)SecuritySystem.Instance).IsNewSecuritySystem())
         return IsGranted(new StateMachineTransitionPermission(StateMachineTransitionModifier.Allow, state.Caption, state.StateMachine.Name));
     var stateMachineTransitionPermission = new Improved.StateMachineTransitionPermission {
         Modifier = StateMachineTransitionModifier.Allow,
         StateCaption = state.Caption,
         StateMachineName = state.StateMachine.Name
     };
     return SecuritySystem.IsGranted(new StateMachineTransitionOperationRequest(stateMachineTransitionPermission));
 }
 bool IsNotGranted(XpoState state) {
     if (!((ISecurityComplex)SecuritySystem.Instance).IsNewSecuritySystem())
         return IsNotGranted(new StateMachineTransitionPermission(StateMachineTransitionModifier.Deny, state.Caption, state.StateMachine.Name));
     var stateMachineTransitionPermission = new Improved.StateMachineTransitionPermission {
         Modifier = StateMachineTransitionModifier.Deny,
         StateCaption = state.Caption,
         StateMachineName = state.StateMachine.Name
     };
     return !SecuritySystem.IsGranted(new StateMachineTransitionOperationRequest(stateMachineTransitionPermission));
 }
        bool IsActive(XpoTransition xpoTransition)
        {
            var permission = new StateMachineTransitionPermission {
                Modifier         = StateMachineTransitionModifier.Allow,
                StateCaption     = xpoTransition.TargetState.Caption,
                StateMachineName = xpoTransition.SourceState.StateMachine.Name,
                Hide             = false
            };

            return(SecuritySystem.IsGranted(new StateMachineTransitionOperationRequest(permission)));
        }
Exemple #4
0
        bool IsNotGranted(XpoState state)
        {
            if (!((ISecurityComplex)SecuritySystem.Instance).IsNewSecuritySystem())
            {
                return(IsNotGranted(new StateMachineTransitionPermission(StateMachineTransitionModifier.Deny, state.Caption, state.StateMachine.Name)));
            }
            var stateMachineTransitionPermission = new Improved.StateMachineTransitionPermission {
                Modifier         = StateMachineTransitionModifier.Deny,
                StateCaption     = state.Caption,
                StateMachineName = state.StateMachine.Name
            };

            return(!SecuritySystem.IsGranted(new StateMachineTransitionOperationRequest(stateMachineTransitionPermission)));
        }
 bool TransitionMatch(StateMachineTransitionPermission permission, StateMachineTransitionOperationRequest permissionRequest)
 {
     return(permissionRequest.Modifier == permission.Modifier &&
            permissionRequest.StateCaption == permission.StateCaption &&
            permissionRequest.StateMachineName == permission.StateMachineName);
 }