*

Alex_PY

  • ***
  • 59 posts
Admin Permissions Manager Plugin - 3 problems
« on: January 20, 2023, 12:56:10 AM »
Hello.
I'm trying to enable two things through this plugin:
1. Approval of a new entry in the Blog (viewing new entries).
2. Permission to edit new entries to activate them.
3. Remove unnecessary rules

1. According to the list of new entries, I have a link:
page=plugins&action=renderplugin&file=blog/admin/list.php&statusId=0

Which I added to the first rule.
Unfortunately - I can NOT enter the number 0 in the statusId parameter, it simply does not save. You have to use the * instead, which is unsafe. I ask you to fix this, and give the opportunity to enter the number 0 as a parameter.
(see the screenshot - on it I tried to enter *,0,1,2 as an example for the statusId parameter - as a result, only *,1,2 remains, and 0 disappears)

2. As a result, I get to see all new blog entries and go to edit a new entry. to post it on the site.
This is a link:
page=plugins&action=renderplugin&file=blog/admin/blog.php&blogId=33

I show it as in the second screenshot.

After I approve a blog entry - I click "Save" and I get an error:
You don't have enough permissions to access this section or do this action.
And the blog entry is not saved and does not appear on the site. And it remains in the "unapproved"

3. When I try to remove unnecessary rules by clicking the "Remove" button - first ask me: Are you sure? - I answer "Yes" - and instead of deleting - the rule that I am trying to delete opens in same window. Accordingly, the rule remains in place - not removed.

Please help solve this problem

*

MB Themes

Re: Admin Permissions Manager Plugin - 3 problems
« Reply #1 on: January 24, 2023, 03:19:56 PM »
For this:
page=plugins&action=renderplugin&file=blog/admin/list.php&statusId=0

You will have:
page => plugins
action => renderplugin
file => blog/admin/list.php
statusId => *

To keep zero in form, you actually need to go into admin/permissions_edit.php
find line:
Code: [Select]
        $val = implode(',', array_filter(array_map('trim', explode(',', $val))));

replace it with:
Code: [Select]
        $val = implode(',', array_filter(array_map('trim', explode(',', $val)), 'strlen'));

as array_filter is droping zeros as empty strings.

(will be included in next update ;) )
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

Alex_PY

  • ***
  • 59 posts
Re: Admin Permissions Manager Plugin - 3 problems
« Reply #2 on: January 24, 2023, 04:53:34 PM »
Thanks for the support, everything worked, 0 appeared.

Can you please tell me when you will be able to fix the remaining problems? And will it be possible to save edits after editing (2nd problem) and delete unnecessary created permission rules (3rd problem)?

*

MB Themes

Re: Admin Permissions Manager Plugin - 3 problems
« Reply #3 on: January 25, 2023, 11:18:14 AM »
2) when saving, there may be different set of parameters, keep that in mind (not visible in browser, you may need to review forms).
3) fixed and plugin updated.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

Alex_PY

  • ***
  • 59 posts
Re: Admin Permissions Manager Plugin - 3 problems
« Reply #4 on: January 25, 2023, 04:01:47 PM »
The third issue has been resolved, thanks for the support.

Let's go back to the second question: Have you tried to simulate the situation that I have outlined for you?

I found at least 2 situations in which this plugin does not allow saving changes.

First: the option with the Blog plugin, which I already told you about
Second: Option for editing e-mail templates (settings - e-mail templates). You can easily reproduce the second situation as follows.

1. Create a new admin

2. In ADMINS PERMISSIONS SETUP - do not give him any rights / prohibitions yet.

3. It can edit email templates.

4. Then click "Configure" - and give it ALL rights - click all checkboxes in all sections to make it look like in the screenshot.

5. We are trying to edit the e-mail template - no access.

The address bar was:
page=emails&action=edit&id=1
Became:
page=emails&action=edit&id=1&apmRedirectFirst=1

6. The same in the blog plugin - no access

The address bar was:
plugins&action=renderplugin&file=blog/admin/blog.php&blogId=32
Became:
plugins&action=renderplugin&file=blog/admin/blog.php&blogId=32&apmRedirectFirst=1

That is - this plugin blocks any editing when I activate it. Blocks editing of both the email template and the blog post.

7. I tried to add apmRedirectFirst=1 to the new rule but that didn't work.

Can you reproduce this situation and tell me what to do?

Sincerely, Alex.
« Last Edit: January 25, 2023, 04:05:12 PM by Alex_PY »

*

Alex_PY

  • ***
  • 59 posts
Re: Admin Permissions Manager Plugin - 3 problems
« Reply #5 on: January 25, 2023, 09:55:22 PM »
Moreover, I ask you to pay attention. Despite the fact that I have the "edit e-mail templates" checkbox clearly selected, I can't do it.

*

MB Themes

Re: Admin Permissions Manager Plugin - 3 problems
« Reply #6 on: January 26, 2023, 09:23:28 AM »
Thanks for feedback, let me try to reproduce these.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

Alex_PY

  • ***
  • 59 posts
Re: Admin Permissions Manager Plugin - 3 problems
« Reply #7 on: January 29, 2023, 12:25:47 PM »
Hello. Haven't solved the editing problem yet?

*

MB Themes

Re: Admin Permissions Manager Plugin - 3 problems
« Reply #8 on: February 01, 2023, 01:05:47 PM »
In struct.sql (or in DB table t_apm_permission) find this one:
('Settings', 'Edit Email Template', '{"page":"emails","action":"edit"}'),

Change it to:
('Settings', 'Edit Email Template', '{"page":"emails","action":"edit"}'),
('Settings', 'Save Email Template', '{"page":"emails","action":"edit_post"}'),


« Last Edit: February 01, 2023, 01:15:43 PM by MB Themes »
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

MB Themes

Re: Admin Permissions Manager Plugin - 3 problems
« Reply #9 on: February 01, 2023, 01:30:40 PM »
This works OK for me on blog.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

Alex_PY

  • ***
  • 59 posts
Re: Admin Permissions Manager Plugin - 3 problems
« Reply #10 on: February 09, 2023, 01:43:04 AM »
Thank you for your support, everything worked. Have a nice day! :)

*

MB Themes

Re: Admin Permissions Manager Plugin - 3 problems
« Reply #11 on: February 09, 2023, 08:02:45 AM »
Glad to hear that ;)
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots