Current filter:
                                You should refresh the page.
                                  • The statement has error, After upgrade to 12.2.6

                                    Dictionary<string, bool> canReadMembers = ((IRequestSecurity)SecuritySystem.Instance).CanReadMembers(type.AssemblyQualifiedName, _membersName, _targetObjectsHandle);

                                    “DevExpress.ExpressApp.Security.IRequestSecurity” has no definition of “CanReadMembers”

                                    How to replace it?

                                1 Solution

                                Creation Date Importance Sort by

                                We replaced the CanReadMembers method with the 'IList<bool> IsGranted(IList<IPermissionRequest> permissionRequests)' method.
                                To use this method, manually create a separate IPermissionRequest object for each member and pass the list of requests to the IsGranted method.
                                Your resultant code will look like this:

                                [C#]
                                public IEnumerable<string> CanReadMembers(string objectType, string membersName, string targetObjectsHandle) { List<string> _membersName = new List<string>(membersName.Split(';')); List<string> _targetObjectsHandle = new List<string>(targetObjectsHandle.Split(';')); Type type = XafTypesInfo.Instance.FindTypeInfo(objectType).Type; List<IPermissionRequest> permissionRequests = new List<IPermissionRequest>(); foreach(string memberName in _membersName) { foreach(string objectHandle in _targetObjectsHandle) { permissionRequests.Add(new ClientPermissionRequest(type, memberName, objectHandle, SecurityOperations.Read)); } } IList<bool> serverRequestResult = ((IRequestSecurity)SecuritySystem.Instance).IsGranted(permissionRequests); List<string> result = new List<string>(); for(int i = 0; i < serverRequestResult.Count; i++) { ClientPermissionRequest request = (ClientPermissionRequest)permissionRequests[i]; result.Add(request.ObjectType + ";" + request.TargetObjectHandle + ";" + request.MemberName + ";" + request.Operation + ";" + serverRequestResult[i].ToString()); } return result; }

                                The order of items in the returned list meets the order of items in the passed list.
                                Internally, this method is used by the GridListEditorMemberLevelSecurityController class to check permissions to visible cells at once.

                                • John01 04.12.2013

                                  Hi Dan
                                  I am new at this. Have tried a few things without luck. What is the complete replacement method for below please?
                                  Thanks
                                  Regards
                                          public IEnumerable<string> CanReadMembers(string objectType, string membersName, string targetObjectsHandle) {
                                              List<string> _membersName = new List<string>(membersName.Split(';'));
                                              List<string> _targetObjectsHandle = new List<string>(targetObjectsHandle.Split(';'));
                                              Type type = XafTypesInfo.Instance.FindTypeInfo(objectType).Type;
                                              Dictionary<string, bool> canReadMembers = ((IRequestSecurity)SecuritySystem.Instance).CanReadMembers(type.AssemblyQualifiedName, _membersName, _targetObjectsHandle);
                                              List<string> result = new List<string>();
                                              foreach(KeyValuePair<string, bool> item in canReadMembers) {
                                                  result.Add(item.Key + ";" + item.Value);
                                              }
                                              return result;
                                          }

                                • Dan (DevExpress) 04.15.2013

                                  I apologize for this inconvenience.
                                  I have replaced my example with yours because it demonstrates the migration changes better (I have updated my initial answer). Please review the code.
                                  Note that the IsGranted method doesn't return a string key, and now you need to manually build it for each returned item. The following line in my code snippet demonstrates how it can be implemented:

                                  result.Add(request.ObjectType + ";" + request.TargetObjectHandle + ";" + request.MemberName + ";" + request.Operation + ";" + serverRequestResult[i].ToString());

                                  Note that I have included it for demonstration purposes. Review your code to see whether or not it is necessary to make additional changes.

                                • Andre Gruz 02.11.2014

                                  Hi Dan,
                                  I am new to Dev Components, I tried login custom service, but am getting new error, Please guide me
                                  Error:
                                  'DevExpress.ExpressApp.Security.IRequestSecurity' does not contain a definition for 'CanReadMembers' and no extension method 'CanReadMembers' accepting a first argument of type 'DevExpress.ExpressApp.Security.IRequestSecurity' could be found (are you missing a using directive or an assembly reference?)     C:\Users\Downloads\XAF_DXTREME_integration_demo\Services\CustomAuthenticationService\CustomAuthenticationDataService.svc.cs     64     99     CustomAuthenticationService

                                • Alexey (DevExpress Support) 02.11.2014

                                  Hello Andre,
                                  I have moved your inquire to the separate thread. Please refer to the Q466609 thread for further correspondence.