Exemplo n.º 1
0
        protected IPermissionRequest CreatePermissionRequest(object entity, string requestedPermission)
        {
            var handle  = ObjectSpace.GetObjectHandle(entity);
            var request = new ClientPermissionRequest(entity.GetType(), null, handle, requestedPermission);

            return(request);
        }
Exemplo n.º 2
0
 void UpdateActionState() {
     if (SecuritySystem.Instance is ISecurityComplex) {
         bool isGranted = true;
         foreach (object selectedObject in View.SelectedObjects) {
             var clientPermissionRequest = new ClientPermissionRequest(typeof(IDashboardDefinition), "Xml", ObjectSpace.GetObjectHandle(selectedObject), SecurityOperations.Write);
             isGranted = SecuritySystem.IsGranted(clientPermissionRequest);
         }
         dashboardEdit.Active["SecurityIsGranted"] = isGranted;
     }
 }
Exemplo n.º 3
0
 void UpdateActionState()
 {
     if (SecuritySystem.Instance is ISecurityComplex)
     {
         bool isGranted = true;
         foreach (object selectedObject in View.SelectedObjects)
         {
             var clientPermissionRequest = new ClientPermissionRequest(typeof(IDashboardDefinition), "Xml", ObjectSpace.GetObjectHandle(selectedObject), SecurityOperations.Write);
             isGranted = SecuritySystem.IsGranted(clientPermissionRequest);
         }
         _dashboardEdit.Active["SecurityIsGranted"]      = isGranted;
         _dashboardExportXml.Active["SecurityIsGranted"] = isGranted;
         _dashboardImportXml.Active["SecurityIsGranted"] = isGranted;
     }
 }
 void UpdateActionState() {
     if (SecuritySystem.Instance is ISecurityComplex) {
         bool isGranted = true;
         foreach (object selectedObject in View.SelectedObjects) {
             var clientPermissionRequest = new ClientPermissionRequest(typeof(IDashboardDefinition), "Xml", ObjectSpace.GetObjectHandle(selectedObject), SecurityOperations.Write);
             isGranted = SecuritySystem.IsGranted(clientPermissionRequest);
         }
         _dashboardEdit.Active["SecurityIsGranted"] = isGranted;
         _dashboardExportXml.Active["SecurityIsGranted"] = isGranted;
         _dashboardImportXml.Active["SecurityIsGranted"] = isGranted;
     }
     var detailView = View as DetailView;
     if (detailView != null) {
         _dashboardEdit.Active["ViewEditMode"] = detailView.AllowEdit;
         _dashboardImportXml.Active["ViewEditMode"] = detailView.AllowEdit;
     }
 }