Details

      Description

      This task aims to:

      1. Check if the implemented MembershipPolicy Framework works properly
      2. Provide a tool to help QA in testing this new feature
      3. Provide an example or reference for documentation and external developers

      This hook:

      • Creates a custom field Security Level for users. By default, the available values are A, B and C.
      • Includes a sample implementation of a Membership Policy.
      • Extends the Edit Site form by adding a new subsection Membership Policy inside the Advanced section. This subsection allows admin users to define the behaviour of the membership policy for this site (See attached screenshots):
        • Forbidden Security Level (only for root sites): Users with the selected security level are not allowed to be members of this site.
        • Mandatory Security Level (only for root sites): Users with the selected security level will automatically be members of this site when they log in and they cannot leave it.
        • Parent Site Membership required (only for child sites): If checked, non-members of the parent site cannot join to this site.
        • Forbidden Roles: Members of this site are not allowed to use these roles
        • Mandatory Roles: Members of this site are automatically assigned to these roles when they log in and they cannot be unassigned.

      In order to use this hook to test the new Membership Policy feature, follow these steps:

      1. Deploy the hook in your Liferay Server (use latest version from master).
      2. Create four Users: User A with Security Level (SL) A, User B with SL B, User C with SL C and User D without any SL.
      3. Create two Site roles Role A and Role B.
      4. Create two Sites Site A and Site B, each with one subsite Subsite A and Subsite B, respectively.
      5. For each of the created Sites, edit its settings and in the Membership Policy subsection apply the configuration described in the following table:
        Site Mandatory Security Level Forbidden Security Level Parent Membership Required Forbidden Roles Mandatory Roles
        Site A A B - Role B Role A
        Subsite A - - Yes - -
        Site B B A - Role A Role B
        Subsite B - - Yes - -
      6. Now validate the expected behaviour for each user, as described in the following table:
        User Security Level Site A Subsite A Site B Subsite B
        User A A Automatic membership after login.
        Cannot leave. Automatic assignment of Role A. Cannot remove Role A.
        Cannot assign role B.
        Can join/leave.
        Can assign/unassign role A and B.
        Cannot join. Cannot join.
        User B B Cannot join. Cannot join. Automatic membership after login.
        Cannot leave. Automatic assignment of Role B. Cannot remove Role B.
        Cannot assign role A.
        Can join/leave.
        Can assign/unassign role A and B.
        User C C Can join/leave.
        Automatic assigment of Role A after joining. Cannot remove Role A.
        Cannot assign role B.
        Can join/leave only if is member of parent site,
        Can assign/unassign role A and B.
        Can join/leave.
        Automatic assigment of Role B after joining. Cannot remove Role B.
        Cannot assign role A.
        Can join/leave only if is member of parent site,
        Can assign/unassign role A and B.
        User D - Can join/leave. No roles assigned automatically.
        Can assign/unassign any role.
        Can join/leave. No roles assigned automatically.
        Can assign/unassign any role.
        Can join/leave. No roles assigned automatically.
        Can assign/unassign any role.
        Can join/leave. No roles assigned automatically.
        Can assign/unassign any role.

        Attachments

          Activity

            People

            • Assignee:
              sergio.gonzalez Sergio Gonzalez (Inactive)
              Reporter:
              eduardo.garcia Eduardo García
              Recent user:
              Randy Zhu (Inactive)
              Participants of an Issue:
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                6 years, 37 weeks, 2 days ago

                Packages

                Version Package