Giter Club home page Giter Club logo

dynamicroles's People

Contributors

ryancramerdesign avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

dynamicroles's Issues

Dublicate Entry when saving

Session: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '1008-122563' for key 'PRIMARY'

Sometimes when I save the DynRole I get this.

I tried to define the "Where can add pages" filter. But when looking in the DB table there's no entries. And also it's not working, say the user can't add pages where I defined.

Sometimes there's errors "dublicate entry" and pages_access_droles_add is empty (sometimes)

There's so many wierd things going on everytime I try this module I don't know what to do or start and assume.

Some experience:

Sometimes I add rules and I have to save the affected role again in the admin to get it working.
Sometimes I get dublicate entry.
Sometimes I define a "where to add pages" but in the db the table stays empty (pages_access_droles_add) But after deleting and creating the dynrole again there suddenly are entries in the db table. Still the feature isn't working without giving explicit access on template level.

Creating droles via API on runtime

I am building a site with customized backend. There are a lot of different permissions which tend to be added often. For example, I have a catlogue with items having page field. I need to limit edit permissions to the items based on the user data end the value of the page field. Dynamic roles seem to be ideal for that, but the page field values will be added often and bew users will be created.

It could be great if I could add droles via API on runtime based on user data. Is it possible? If not, are therea ny other ways to acomplish that?

multiple parent_ids where only one is expected

I think I have found an issue. I get two error messages:

Notice: Array to string conversion in /www/htdocs/w012f278/aki.nogajski.de/wire/core/PageFinder.php on line 1344

Warning: preg_match() expects parameter 2 to be string, array given in /www/htdocs/w012f278/aki.nogajski.de/wire/core/Sanitizer.php on line 328

The line 1344 in PageFinder is: if(!ctype_digit("$parent_id")) { and a check with var_dump($parent_id) in line 1343 shows array(2) { [0]=> string(4) "1121" [1]=> string(4) "1014" }.

And the line 328 in Sanitizer belongs to public function path($value, $maxLength = 1024) { and $value here is the same Array with the two ids.


I get this with a single dynamic role that I have setup with 2 'has_parent' with OR condition:
template=50|44, has_parent=1121|1014, status=unpublished

Not compatible with 3.x

Good day!
This super-module seems not to be compatible with 3.x branch. Could it be fixed easily?

Content not showing for guests

Hi, I've come across another issue, but I'm not sure if it's a bug or an intended feature.

Basically I have set up a Dynamic Role purely for guests, but when I add a rule to allow them to view a certain template, they can't. So I'll run through the steps.

  1. I uncheck "View Pages" from the basic-page template for all roles.
  2. I create a new test page which uses the basic-page template.
  3. Viewing this page is forbidden for guests as expected from the front-end.
  4. I create a new Dynamic Role roles->Has->guest and template->Equals->basic-page

I would now expect to see the test page without being logged in, but permission is denied. If however I create a new role, let's say General and assign a member to this role and login, I can see the test page and I assume this is because they also automatically have the guest role.

So the issue seems to be when the person isn't logged in, and is purely a guest.

If this is how it's supposed to work, is there a way we can create a Dynamic Role purely for guests? The reason being, I prefer deal with all the permissions for templates etc on one page like can be done with DR.

Thanks

Addin two has_parent to editable pages gives warning

Notice: Array to string conversion in //wire/core/PageFinder.php on line 1344 Warning: preg_match() expects parameter 2 to be string, array given in //wire/core/Sanitizer.php on line 328 trifft auf 61434 Seiten zu

image

Can't add more than 3 filters

I have Multiplier installed and added 3 Filter Rules for "what can they view". Now I wanted to add another 4th filter, and upped the setting to allow 4. Now the "Add" button is shown again and I can add a new filter row. But it isn't saved.

Using PW 2.6.18 and latest DynRoles

Using DynRoles doesn't allow for "Add new" function

Since I don't want to set edit/add access on template but using DynRoles, there's no "Add new" functionality possible.

When I add edit/add access on template level I can't use DynRoles to say on which pages they can edit/add pages since we can't ”revoke" access he will also be able to edit or add pages where I don't want to.

It can get complicated to setup things and test. It seems very limited for certain use cases.

Is this module working or in use and tested?

I'm not sure what this module is used for or if it's even used anywhere . But currently the drawbacks this module brings (if assuming it's working) defeat its own purpose.

What is the purpose of this module when it doesn't allow me to define "where" to add pages, without giving the role "add chilrdren" access to the parent template? Cause then the user can also add pages in other places which I can't control then. Since it's not revoking access makes this approach very difficult. Or maybe there's bugs or I don't understand how to use it or for what special scenario.

Also as mentioned in other issue. When I'm not setting access on template level, the "Add new" feature isn't working and if I give access on template level there's no use for DynRoles anymore.

When having 1 dyn role, other roles can't add pages anymore

I ran into a problem while testing. I have a role to edit and add pages throughout admin (defined in home template). User with this can add and edit pages fine.

Now if I create a dyn role explicit for ANOTHER role, with some edit and view etc, and only for page with basic-page for example. As soon as this is created the role I mentioned earlier can't add page anymore. The "new" button disappeared. When I delete the dyn role, they reappear.

I don't think this should be the case, as soon as I add a dyn role for a specific role other roles can't add pages anymore.

Adding a new page doesn't run rebuildForPage method

The rebuildForPage method is not being called when a new page is added, which means that the new page won't have the correct permission for the drole.

This fixes it for me (note the addition of !$page->created):

} else if(count($changes) || !$page->created) {
    $this->rebuildForPage($page);
}

I did notice something a little weird though - when saving an existing page without changing anything, this method is still being called because the changes array always seems to contain "status" even if I haven't changed the status of the page. Any ideas on this?

Adding pages where allowed by this module to add pages doesn't work

I end up with an error after addin->saving the page. Where the page should be created and edited I get:

Error: Call to a member function of() on a non-object (line 665 of /*/wire/core/Page.php)

I'm not sure why this doesn't work. Cross link to issue report on dev ryancramerdesign/ProcessWire#892

I once deleted all users, but recreated them and set the created user id in db to be admin again. But since this is on creating a new page I don't know what's up. Kinda would be great to fix this as I need DynRoles for this project. I'll also try to search.

PW 2.5.19 where you already changed something there, but still get this error.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.