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

default namespace ACL must include create if other namespace allows create #1705

Closed
RogerHaase opened this issue Jul 2, 2024 · 2 comments
Closed
Labels
bug Something isn't working prio4

Comments

@RogerHaase
Copy link
Member

If wikiconfig.py has ACL for NAMESPACE_USERS:

default='All:read,write,create,destroy,admin',

and ACL for NAMESPACE_DEFAULT:

default='All:read,write',

then a user who is not logged in may read/modify/destroy/admin (change ACL on modify) an item in users namespace. But same user may not create an item in users namespace. Attempts to do so result in:

Item not found

Item 'xxx' does not exist.

Workaround is to change ACL for NAMESPACE_DEFAULT:

default='All:read,write,create',
@UlrichB22
Copy link
Collaborator

Thanks, the fix is working fine for the described issue.

There are some more parts in items/__init__.py to check (search for user.may), e.g. if you type '+modify/users/xxx' in your browser URL for a non-existent item. You will run into this check:

if isinstance(self.content, NonExistentContent) and not flaskg.user.may.create(self.name):

I am not sure if edit-locking and conflict checking is working as expected because it also uses self.name.

@RogerHaase
Copy link
Member Author

Thanks. Agree, looking at several other places where self.name s/b self.fqname. Trying to create errors.

RogerHaase added a commit to RogerHaase/moin that referenced this issue Sep 22, 2024
…inwiki#1705

use fqname not name when checking permission to modify an item

use fqname not name when redirecting after failing to obtain edit lock

use fqname.fullname not name when processing edit conflicts

use fqname not name when checking permission to update new item revision

use fqname.fullname not name on edit lock sql db

cleanup comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working prio4
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants