Uploaded image for project: 'Jackrabbit Oak'
  1. Jackrabbit Oak
  2. OAK-7782

Clarify error on aggregate privilege registration with non existing privileges

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.10.0, 1.9.9
    • Component/s: core, security
    • Labels:
      None

      Description

      Trying to register an aggregate privilege based on non existing privileges fails with a pretty cryptic error [0]. To clarify, the non existing ones are filtered out of the set, but if nothing remains (none of the provided ones actually exists), this error happens.

      I would like to clarify the expected behavior by wrapping it in a proper RepositoryException. This will not change the behavior, only the message and the error type.

      [0]

      javax.jcr.nodetype.ConstraintViolationException: OakConstraint0048: PrivilegeBits are missing.
          at org.apache.jackrabbit.oak.api.CommitFailedException.asRepositoryException(CommitFailedException.java:226)
          at org.apache.jackrabbit.oak.api.CommitFailedException.asRepositoryException(CommitFailedException.java:213)
          at org.apache.jackrabbit.oak.security.privilege.PrivilegeDefinitionWriter.writeDefinitions(PrivilegeDefinitionWriter.java:122)
          at org.apache.jackrabbit.oak.security.privilege.PrivilegeDefinitionWriter.writeDefinition(PrivilegeDefinitionWriter.java:69)
          at org.apache.jackrabbit.oak.security.privilege.PrivilegeManagerImpl.registerPrivilege(PrivilegeManagerImpl.java:86)
      
      Caused by: org.apache.jackrabbit.oak.api.CommitFailedException: OakConstraint0048: PrivilegeBits are missing.
          at org.apache.jackrabbit.oak.security.privilege.PrivilegeValidator.validateDefinition(PrivilegeValidator.java:161)
          at org.apache.jackrabbit.oak.security.privilege.PrivilegeValidator.childNodeAdded(PrivilegeValidator.java:99)
          at org.apache.jackrabbit.oak.security.privilege.PrivilegeValidator.childNodeAdded(PrivilegeValidator.java:1)
          at org.apache.jackrabbit.oak.spi.commit.CompositeEditor.childNodeAdded(CompositeEditor.java:107)
          at org.apache.jackrabbit.oak.spi.commit.EditorDiff.childNodeAdded(EditorDiff.java:115)
          at org.apache.jackrabbit.oak.plugins.memory.MemoryNodeState.compareAgainstBaseState(MemoryNodeState.java:168)
          at org.apache.jackrabbit.oak.spi.commit.EditorDiff.childNodeChanged(EditorDiff.java:147)
          at org.apache.jackrabbit.oak.plugins.memory.MemoryNodeState.compareAgainstBaseState(MemoryNodeState.java:161)
          at org.apache.jackrabbit.oak.spi.commit.EditorDiff.childNodeChanged(EditorDiff.java:147)
          at org.apache.jackrabbit.oak.plugins.memory.ModifiedNodeState$2.childNodeChanged(ModifiedNodeState.java:446)
          at org.apache.jackrabbit.oak.plugins.memory.MemoryNodeState.compareAgainstBaseState(MemoryNodeState.java:161)
          at org.apache.jackrabbit.oak.plugins.memory.ModifiedNodeState.compareAgainstBaseState(ModifiedNodeState.java:421)
          at org.apache.jackrabbit.oak.spi.commit.EditorDiff.process(EditorDiff.java:51)
          at org.apache.jackrabbit.oak.spi.commit.EditorHook.processCommit(EditorHook.java:54)
          at org.apache.jackrabbit.oak.spi.commit.CompositeHook.processCommit(CompositeHook.java:60)
          at org.apache.jackrabbit.oak.plugins.memory.MemoryNodeStore$MemoryNodeStoreBranch.merge(MemoryNodeStore.java:294)
          at org.apache.jackrabbit.oak.plugins.memory.MemoryNodeStore.merge(MemoryNodeStore.java:133)
          at org.apache.jackrabbit.oak.core.MutableRoot.commit(MutableRoot.java:250)
          at org.apache.jackrabbit.oak.core.MutableRoot.commit(MutableRoot.java:261)
          at org.apache.jackrabbit.oak.security.privilege.PrivilegeDefinitionWriter.writeDefinitions(PrivilegeDefinitionWriter.java:119)
          ... 28 more
      
      

        Attachments

          Activity

            People

            • Assignee:
              stillalex Alex Deparvu
              Reporter:
              stillalex Alex Deparvu
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: