acl
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
acl [2015-08-28 20:55] – old revision restored (2015-05-24 08:08) 2001:4dd0:ff00:9581:69bf:cc40:5c33:323b | acl [2023-05-26 08:52] (current) – old revision restored (2023-03-16 20:56) Aleksandr | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Access Control Lists (ACL) ====== | + | ====== Access Control Lists (ACL)s ====== |
- | [[DokuWiki]]---like most wikis---is very open by default. Everyone is allowed to create, edit and delete pages. However sometimes it makes sense to restrict access to certain or all pages. This is when //Access Control List// (ACL) comes into play. This page should give you an overview of how ACLs work in DokuWiki and how they are configured. | + | |
+ | [[DokuWiki]] --- like most wikis --- is very open by default. Everyone is allowed to create, edit and delete pages. However sometimes it makes sense to restrict access to certain or all pages. This is when the //Access Control List// (ACL) comes into play. This page gives an overview of how ACLs work in DokuWiki and how they are configured. | ||
===== Configuration and Setup ===== | ===== Configuration and Setup ===== | ||
- | ACLs can be enabled in the [[installer]] and an initial ACL policy is set there as well. To manually enable ACLs, switch on the [[config: | + | ACLs can be enabled in the [[installer]] and an initial ACL policy is set there as well. To manually enable ACLs, switch on the [[config: |
+ | |||
+ | |||
+ | Example of a minimal ''conf/ | ||
+ | |||
+ | <file php conf/users.auth.php> | ||
+ | # login: | ||
+ | |||
+ | admin: | ||
+ | </ | ||
==== See also ===== | ==== See also ===== | ||
There are a few more config options and features that relate to authentication, | There are a few more config options and features that relate to authentication, | ||
- | * Config option [[config: | + | * Config option [[config: |
- | * Config option [[config: | + | * Config option [[config: |
- | * Config option [[config:disableactions]] - allows you to disable open registration | + | * Config option [[config:defaultgroup]] -- the default group to which new users are added |
- | * Config option [[config: | + | * [[plugin: |
- | * [[plugin: | + | * [[auth|Authentication Backends]] |
- | * [[auth|Authentication Backends]] - identify users from different data sources | + | * [[faq: |
- | * [[faq: | + | |
:!: **WARNING: | :!: **WARNING: | ||
- | |||
===== Access Restrictions ===== | ===== Access Restrictions ===== | ||
Line 33: | Line 42: | ||
Users are in the groups they were assigned to in the user manager (or the auth backend). However there are two **groups** that are somewhat special: | Users are in the groups they were assigned to in the user manager (or the auth backend). However there are two **groups** that are somewhat special: | ||
- | * **@ALL**. Everyone, even users not logged in, is a member of the ALL group. You can use this group to restrict access for all users (as a default setting) and then relax the permissions for some selected users. | + | * **@ALL** Everyone, even users not logged in, is a member of the ALL group. You can use this group to restrict access for all users (as a default setting) and then relax the permissions for some selected users. |
- | * **@user**. All self-registered users are by default automatically a member of the group ' | + | * **@user** All self-registered users are by default automatically a member of the group ' |
Groups are represented internally and in the ACL manager by a prepended '' | Groups are represented internally and in the ACL manager by a prepended '' | ||
Line 48: | Line 57: | ||
* by selecting a known group or user from the dropdown menu | * by selecting a known group or user from the dropdown menu | ||
* or by selecting " | * or by selecting " | ||
- | - set the appropriate | + | - set the appropriate |
Existing rules can be modified or deleted in the table at the bottom of the ACL manager. | Existing rules can be modified or deleted in the table at the bottom of the ACL manager. | ||
Line 63: | Line 72: | ||
- User //bigboss// is given full rights. | - User //bigboss// is given full rights. | ||
- Now the access for the '' | - Now the access for the '' | ||
- | - Well not nobody really---we give members of the //devel// group full rights here. | + | - Well not nobody really---we give members of the //devel// group almost |
- | - And of course | + | - User // |
- | - And the // | + | - The // |
- | - However the devel guys don't want their boss to see the '' | + | - However the devel team doesn't want their boss to see the '' |
- | - And finally the // | + | - And finally the // |
- | - Then the permissions for the namespace '' | + | - Then the permissions for the namespace '' |
- | - The last line finally restricts the start page to readonly for everyone. Only superusers will be able to ever edit that page. | + | * other users will be matched by line #1 so they can still create and edit. |
+ | * Rights for // | ||
+ | - The last line finally restricts the start page to readonly for everyone. Even for //bigboss//. Only superusers will be able to ever edit that page. | ||
Let's have a look at a second example to better understand **specific matching**: | Let's have a look at a second example to better understand **specific matching**: | ||
{{: | {{: | ||
+ | |||
This time we look what rules will match for different users when trying to access the page '' | This time we look what rules will match for different users when trying to access the page '' | ||
Line 108: | Line 120: | ||
There are 7 permission levels represented by an integer. Higher levels include lower ones. If you can edit you can read, too. However the //admin// permission of //255// can not be used in the '' | There are 7 permission levels represented by an integer. Higher levels include lower ones. If you can edit you can read, too. However the //admin// permission of //255// can not be used in the '' | ||
- | ^ Name | + | ^ Name ^ Level ^ applies to ^ Permission ^ DokuWiki constant |
- | | none | + | | none | 0 | pages, namespaces |
- | | read | + | | read | 1 | pages, namespaces |
- | | edit | + | | edit | 2 | pages, namespaces |
- | | create | 4 | namespaces | + | | create |
- | | upload | 8 | namespaces | + | | upload |
- | | delete | 16 | namespaces | + | | delete |
- | | admin | 255 | admin plugins | + | | admin |
Here is an example setup matching the first example given above: | Here is an example setup matching the first example given above: | ||
Line 134: | Line 146: | ||
Please note that **order does not matter** in the file. The file is parsed as whole, then a perfect match for the current page/user combo is searched for. When a match is found further matching is aborted. If no match is found, group permissions for the current page are checked. If no match is found the check continues in the next higher namespace. | Please note that **order does not matter** in the file. The file is parsed as whole, then a perfect match for the current page/user combo is searched for. When a match is found further matching is aborted. If no match is found, group permissions for the current page are checked. If no match is found the check continues in the next higher namespace. | ||
- | :!: **Note: | + | :!: **Note: |
+ | |||
+ | ==== User/Group Encoding ==== | ||
+ | |||
+ | Because the ACL configuration uses a few special | ||
+ | |||
+ | When you use the ACL Manager you don't have to think about this, it will do it automatically for you. | ||
+ | |||
+ | When manually editing ACLs, user and group names need to be encoded. Internally this is done using the [[xref> | ||
+ | |||
+ | The encoding uses URL encoding for all non-letter/ | ||
+ | |||
+ | Example: '' | ||
- | :!: **Note:** When using $conf[' | ||
- | :!: **Note:** The delete permission affects media files only. Pages can be deleted (and restored) by everyone with at least edit permission. Someone who has upload permissions but no delete permissions can not overwrite existing media files anymore. | ||
==== User Wildcards ==== | ==== User Wildcards ==== | ||
Line 144: | Line 167: | ||
It is possible to use user and group wildcards in the ACLs. This can be useful for Wikis with many registered users, if you want to give each user or group a personal namespace where only he/she has write access, and you don't want to edit the ACLs for each of them. To accomplish that **'' | It is possible to use user and group wildcards in the ACLs. This can be useful for Wikis with many registered users, if you want to give each user or group a personal namespace where only he/she has write access, and you don't want to edit the ACLs for each of them. To accomplish that **'' | ||
- | In the following example a logged-in user gains full access (upload/ | + | In the following example a logged-in user gains full access (upload/ |
+ | |||
+ | In this case logged-in user has access to own namespace only and have not access to users namespaces (even view names of namespaces) of other users. | ||
< | < | ||
# | # | ||
# Grant full access to logged in user's namespace | # Grant full access to logged in user's namespace | ||
- | user: | + | user: |
# | # | ||
# Allow to browse own namespace via the index | # Allow to browse own namespace via the index | ||
- | user: %USER% | + | user: %USER% |
# | # | ||
# Allow read only access to start page located in " | # Allow read only access to start page located in " | ||
- | user: | + | user: |
# | # | ||
# Disable all access to user's home namespaces not owned by logged in user | # Disable all access to user's home namespaces not owned by logged in user | ||
# (include view namespaces via the index) | # (include view namespaces via the index) | ||
- | user: | + | user: |
# | # | ||
# Allow members of ' | # Allow members of ' | ||
- | # be careful, if you have a user namespace, all members of the default group | + | # BE CAREFUL, if you have a 'user' |
- | # will gain access to it | + | # will gain access to it since %GROUP% will be replaced literally |
- | %GROUP%: | + | %GROUP%: |
</ | </ | ||
- | :!: **Note:** version 2009-12-25c " | + | :!: **Note:** version 2009-12-25c " |
:!: **Note:** The wildcard changed from @ to % in December 2008 -- if you are upgrading from an older version you need to adjust your ACL setup accordingly. | :!: **Note:** The wildcard changed from @ to % in December 2008 -- if you are upgrading from an older version you need to adjust your ACL setup accordingly. |
acl.1440788116.txt.gz · Last modified: 2015-08-28 20:55 by 2001:4dd0:ff00:9581:69bf:cc40:5c33:323b