Skip to content

check passes access rule constraints with a token MxBuild rejects (build: CE0161) #1843

Open

Description

@Joshua-TOF

What happens

Since fd51d9f (#1803), check -p reports most access-rule constraints that fail the build with CE0161. These still pass check -p and exec, and mx check (11.14.0, security level Production) then reports:

[error] [CE0161] "Error(s) in XPath constraint." at Access rule of entity 'M.E'
grant read * on entity M.E to M.User where [Title = '[%CurrentDateTime%]'];   -- date token on a String
grant read * on entity M.E to M.User where [Title = '[%BeginOfCurrentDay%]'];  -- date token on a String
grant read * on entity M.E to M.User where [Title = '[%UserRole_User%]'];      -- user role token on a String
grant read * on entity M.E to M.User where [D = '[%UserRole_User%]'];          -- user role token on a DateTime
grant read * on entity M.E to M.User where [Cnt = '[%CurrentDateTime%]'];     -- quoted token on an Integer
grant read * on entity M.E to M.User where [Cnt = '[%DayLength%]'];           -- quoted token on an Integer
grant read * on entity M.E to M.User where [M.E_Kid = '[%CurrentUser%]'];      -- M.E_Kid leads to M.Kid, not a user

Why

literalTypeProblem judges [%CurrentUser%] and returns early for every other token ("its type is not modelled here"). And literalTypeProblems only looks up attributes, so '[%CurrentUser%]' compared with an association is never judged.

Expected

check -p reports these at the grant. Measured legal and to stay silent: [D = '[%CurrentDateTime%]'], [D > '[%BeginOfCurrentDay%]'], [M.E_Owner = '[%CurrentUser%]'] (System.User) and [M.E_Acc = '[%CurrentUser%]'] (Administration.Account, a specialization of System.User).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions