Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not display options for Site Administrator to create, modify, or delete Manager users #5244

Merged
merged 8 commits into from
Mar 6, 2024

Conversation

wesleybl
Copy link
Member

@wesleybl wesleybl commented Sep 29, 2023

@netlify
Copy link

netlify bot commented Sep 29, 2023

Deploy Preview for volto ready!

Name Link
🔨 Latest commit b21fdc9
🔍 Latest deploy log https://app.netlify.com/sites/volto/deploys/65e8ab29d610930008f4a11a
😎 Deploy Preview https://deploy-preview-5244--volto.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@sneridagh
Copy link
Member

@wesleybl are you aware that we have a GSOC that is taking care of improving the User Control Panel?
Please ping @robgietema about it, and how to merge this work with theirs.

@wesleybl
Copy link
Member Author

wesleybl commented Nov 6, 2023

@sneridagh maybe this PR isn't the same thing @robgietema is doing. This needs modifications to plone.restapi, which are being done in: plone/plone.restapi#1712

I am making the changes requested in @davisagli ' review. After these modifications, I will need to modify this PR here as well.

Anyway, I would like to know what @robgietema is doing.

Copy link

netlify bot commented Feb 20, 2024

Deploy Preview for plone-components canceled.

Name Link
🔨 Latest commit b21fdc9
🔍 Latest deploy log https://app.netlify.com/sites/plone-components/deploys/65e8ab29f7a6820008d712ce

@wesleybl wesleybl force-pushed the site_administrator branch 2 times, most recently from 09a6247 to 628a252 Compare February 20, 2024 16:17
@wesleybl
Copy link
Member Author

@sneridagh @davisagli @ksuess as suggested by @davisagli and @ksuess in plone/plone.restapi#1712, I removed the can delete and can assign information from the endpoints and adapted this PR to search for the althenticated user roles and make the necessary blocks in interface.

Can you take a look please?

@wesleybl wesleybl requested a review from ksuess February 20, 2024 20:19
Copy link
Member

@ksuess ksuess left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great!
I tested. Also with many_users/many_groups.
LGTM

@ksuess
Copy link
Member

ksuess commented Feb 22, 2024

Maybe a test for a non-manager?

  it('renders a UsersControlpanelUser component with options disabled if not allowed', () => {
    const store = mockStore({
      intl: {
        locale: 'en',
        messages: {},
      },
    });
    const component = renderer.create(
      <Provider store={store}>
        <RenderUsers
          user={testUser}
          roles={testRoles}
          onDelete={() => {}}
          isUserManager={false}
        />
      </Provider>,
    );
    const json = component.toJSON();
    expect(json).toMatchSnapshot();
  });

@wesleybl
Copy link
Member Author

Maybe a test for a non-manager?

@ksuess I added the test. Thanks for your review!

@ksuess
Copy link
Member

ksuess commented Feb 22, 2024

Would you add also a test for a non-manager user for groups in RenderGroups.test.js?

I'll add tests for user group membership control panel. #5786 later.

@wesleybl
Copy link
Member Author

Would you add also a test for a non-manager user for groups in RenderGroups.test.js?

Done

@ksuess
Copy link
Member

ksuess commented Mar 1, 2024

Dear maintainers, please have a look.

packages/volto/src/helpers/User/User.js Show resolved Hide resolved
* @method canAssingGroup
* @returns {boolean}
*/
export function canAssingGroup(isManager, group) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is misspelled:

Suggested change
export function canAssingGroup(isManager, group) {
export function canAssignGroup(isManager, group) {

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix.

@wesleybl
Copy link
Member Author

wesleybl commented Mar 6, 2024

@sneridagh can we merge this PR?

@sneridagh sneridagh merged commit c91d265 into main Mar 6, 2024
73 checks passed
@sneridagh sneridagh deleted the site_administrator branch March 6, 2024 21:37
sneridagh added a commit that referenced this pull request Mar 14, 2024
* main: (299 commits)
  Release 18.0.0-alpha.20
  Add BBB code for removed WysiwygWidget (#5874)
  Release 18.0.0-alpha.19
  Release @plone/components 2.0.0-alpha.7
  Release @plone/slate 18.0.0-alpha.10
  Release generate-volto 9.0.0-alpha.11
  Release @plone/types 1.0.0-alpha.6
  Improve deps in project generator (#5872)
  Fix broken link to TanStack Query (#5871)
  Add missing nextjs install step (#5857)
  (Fix): Sorting Order and Sorting On are not working in Search Block edit mode (#5262)
  Update docs for defaultBlockType setting (#5862)
  Add reference to Docker installation for some Linux distributions (#5861)
  Fix further internal `blocksConfig` pass by reference present in core (related to #5850) (#5859)
  The proper name is Semantic UI (#5855)
  Update link to cssnano docs (#5853)
  [components] Container css (#5849)
  Do not display options for Site Administrator to create, modify, or delete Manager users (#5244)
  Fix the introduction of a mutable (referenced) object when assigning … (#5850)
  Remove draftJS (and related legacy blocks `text`, `table` and `hero`) from core and cleanup dependencies (#5846)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants