I've just run into an issue with my simple app that prevents me from saving objects that inherent from other objects with the error:
"You can not save the 'DevExpress.ExpressApp.DC.GeneratedClasses.IAwardData_Data_Matter(**guid**)' object due to security restrictions."
(where **guid** is an actual GUID)
This issue may be linked to my upgrade from vol 2.5 to vol 2.7, but I'm not positive as other changes were made. In the attached app, both "Client" and "Matter" are impacted.
Steps to Reproduce:
Run the attached project.
Open the "Administrator" Role detail view. -> The Permissions list view does not contain types for many-to-many associations.
Try to create and save a Matter object. -> A security exception is raised.
Refresh the "Administrator" Role detail view. -> The Permissions list view now contains DevExpress.ExpressApp.DC.GeneratedClasses group with intermediate entities, but access to them is denied.
I have already posted a solution for this at:
I have modified a little bit to take care of secured non persistent types.
Here is the code (same as the attached file)
Imports DevExpress.ExpressApp.Security Imports DevExpress.ExpressApp.DC Imports DevExpress.ExpressApp Namespace Security Public Class SecurityStrategyComplexEx Inherits SecurityStrategyComplex Public Sub New() End Sub Public Sub New(ByVal userType As Type, ByVal roleType As Type, ByVal authentication As AuthenticationBase) MyBase.New(userType, roleType, authentication) End Sub Public Overrides Function IsGranted(permissionRequest As IPermissionRequest) As Boolean If TypeOf permissionRequest Is AnyMemberOperationPermissionRequest Then Dim request As AnyMemberOperationPermissionRequest = CType(permissionRequest, AnyMemberOperationPermissionRequest) Dim TypeInfo As ITypeInfo = XafTypesInfo.Instance.FindTypeInfo(request.ObjectType) Dim Found As Boolean = False For Each TI As ITypeInfo In XafTypesInfo.Instance.PersistentTypes If TI.Equals(TypeInfo) Then Found = True Exit For End If Next If Not Found Then If Not SecurityStrategy.SecuredNonPersistentTypes.Contains(TypeInfo.Type) Then Return True End If End If End If Return MyBase.IsGranted(permissionRequest) End Function End Class End Namespace