title: Devexpress XAF New Security System - Criteria in "SecuritySystemObjectPermissionsObject" Class
body: <p>I am using New Security System in my XAF Project. I have created custom security classes "ExtendedSystemSecurityRole" and "SecuritySystemUser". In Updater class I have created a role named "G1" and its permissions as follows. But when running, User "John" Can not see the "Buyer" form.</p>
  
  <pre><code>ExtendedSecuritySystemRole basicUserRole = ObjectSpace.FindObject&lt;ExtendedSecuritySystemRole&gt;(new BinaryOperator("Name", "G1"));
          if (basicUserRole == null)             
          {
              basicUserRole = ObjectSpace.CreateObject&lt;ExtendedSecuritySystemRole&gt;();
              basicUserRole.Name = "G1";
              SecuritySystemTypePermissionObject userTypePermission =
                  ObjectSpace.CreateObject&lt;SecuritySystemTypePermissionObject&gt;();
              userTypePermission.TargetType = typeof(Buyer);
              SecuritySystemObjectPermissionsObject currentUserObjectPermission =
                  ObjectSpace.CreateObject&lt;SecuritySystemObjectPermissionsObject&gt;();
  
              currentUserObjectPermission.Criteria = "[Active] = True";
              currentUserObjectPermission.AllowNavigate = true;
              currentUserObjectPermission.AllowRead = true;
              userTypePermission.ObjectPermissions.Add(currentUserObjectPermission);
              basicUserRole.TypePermissions.Add(userTypePermission);
          }
          ExtendedSecuritySystemUser userJohn =
              ObjectSpace.FindObject&lt;ExtendedSecuritySystemUser&gt;(
              new BinaryOperator("UserName", "John"));
          if (userJohn == null)
          {
              userJohn = ObjectSpace.CreateObject&lt;ExtendedSecuritySystemUser&gt;();
              userJohn.UserName = "John";
              userJohn.SetPassword("");
              userJohn.Roles.Add(basicUserRole);
          }
  </code></pre>