Uploaded image for project: 'User Directory'
  1. User Directory
  2. UD-78

Add CheckCurrentUserContentCondition AND/OR CurrentUserContentAccessControler

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 2.1.0
    • None
    • None
    • M5
    • 4.1 M6

      At this time the user can not edit its own user content

      The CurrentUserContentAccessControler should provide front edition right on /cms ?...?

      This is the actual code in the project

      /**
       * Check if the content matches the current user
       */
      public class CheckCurrentUserContentCondition implements Condition
      {
      
          public boolean passesCondition(Map transientVars, Map args, PropertySet ps) throws WorkflowException
          {
              WorkflowAwareContent content = (WorkflowAwareContent) transientVars.get(AbstractContentWorkflowComponent.CONTENT_KEY);
              
              if (content == null)
              {
                  throw new WorkflowException("Unable to retrieve content");
              }
      
              String language = content.getLanguage();
              String currentUserContent = UserXSLTHelper.getCurrentUserContent(language);
              
              return currentUserContent != null && currentUserContent.equals(content.getId());
          }
      
      }

            laurence Laurence Aumeunier
            fravetier Frederic Ravetier (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: