2011-11-01 06:03:20 +01:00
|
|
|
# F=wild repositories named with wildcards
|
2009-12-06 07:11:02 +01:00
|
|
|
|
|
|
|
***IMPORTANT NOTE***:
|
|
|
|
|
2010-02-05 11:30:47 +01:00
|
|
|
This feature may be somewhat "brittle" in terms of security. Creating
|
|
|
|
repositories based on wild cards, giving "ownership" to the specific user who
|
custom perm categories in setperms (WARNING: PLEASE READ FULL COMMIT MESSAGE)
THE COMPILED CONFIG FILE FORMAT CHANGES WITH THIS VERSION. PLEASE DO
NOT MIX VERSIONS OR DOWNGRADE. Upgrading using normal gitolite upgrade
means should be fine, though.
Originally, we only allowed "R" and "RW" as categories of users supplied
to the `setperms` command. These map respectively to "READERS" and
"WRITERS" in the access rules.
Now:
- we prefer READERS instead of R and WRITERS instead of RW
- we allow the admin to define other categories as she wishes
(example: MANAGERS, TESTERS, etc). These do not have abbreviations,
however, so they must be supplied in full.
PLEASE, *PLEASE*, read the section in doc/wildcard-repositories.mkd for
more info. This is a VERY powerful feature and if you're not careful
you could mess up the ACLs nicely.
Backward compat note: you can continue to use the "R" and "RW"
categories when running the "setperms" command, and gitolite will
internally convert them to READERS and WRITERS categories.
----
implementation notes:
- new RC var called GL_WILDREPOS_PERM_CATS that is a space-sep list of
the allowed categories in a gl-perms file; defaults to "R RW" if not
specified
- wild_repo_rights no longer returns $c, $r, $wC, where $r = $user if
"R $user", $r = '@all' if "R @all", and similarly with $w and "RW".
Instead it returns $c and a new hash that effectively gives the same
info, but expanded to include any other valid categories (listed in
GL_WILDREPOS_PERM_CATS)
- consequently, the arguments that parse_acl takes also change the
same way
- (side note: R and RW are quietly converted to READERS and WRITERS;
however, new categories that you define yourself do not have
abbreviations)
- setperms validates perms to make sure only allowed categories are
used; however even if someone changed them behind the scenes,
wild_repo_rights will also check. This is necessary in case the
admin tightened up GL_WILDREPOS_PERM_CATS after someone had already
setperms-d his repos.
- as a bonus, we eliminate all the post-Dumper shenanigans, at least
for READERS and WRITERS. Those two now look, to the compile script,
just like any other usernames.
2010-11-06 06:16:17 +01:00
|
|
|
created it, allowing him/her to hand out permissions to other users to
|
|
|
|
collaborate, all these are possible. And any of these could have a bug in it.
|
|
|
|
I haven't found any yet, but that doesn't mean there aren't any.
|
2009-12-06 07:11:02 +01:00
|
|
|
|
|
|
|
----
|
|
|
|
|
|
|
|
This document is mostly "by example".
|
|
|
|
|
|
|
|
----
|
|
|
|
|
2011-11-01 06:03:20 +01:00
|
|
|
## quick introduction
|
2010-09-23 10:34:04 +02:00
|
|
|
|
|
|
|
The wildrepos feature allows you to specify access control rules using regular
|
|
|
|
expression patterns, so you can have many actual repos being served by a
|
|
|
|
single set of rules in the config file. The regex pattern can also include
|
|
|
|
the word `CREATOR` in it, allowing you to parametrise the name of the user
|
|
|
|
creating the repo. The examples below will make this clearer.
|
|
|
|
|
2011-11-01 06:03:20 +01:00
|
|
|
## rc file setting required
|
2010-04-29 10:58:03 +02:00
|
|
|
|
|
|
|
This feature requires that you set `$GL_WILDREPOS` to "1" in `~/.gitolite.rc`
|
2011-01-27 14:57:36 +01:00
|
|
|
on the server. Please search for that variable in `doc/gitolite.rc.mkd`
|
|
|
|
for more information on this.
|
2010-04-29 10:58:03 +02:00
|
|
|
|
2011-11-01 06:03:20 +01:00
|
|
|
## examples of wildcard repos
|
2010-05-21 14:23:05 +02:00
|
|
|
|
2010-09-23 10:34:04 +02:00
|
|
|
As the introduction said, you can include the word `CREATOR` in the regex
|
|
|
|
pattern, though it is not mandatory. We'll look at examples of both types of
|
|
|
|
usage.
|
2009-12-06 07:11:02 +01:00
|
|
|
|
|
|
|
Which of these alternatives you choose depends on your needs, and the social
|
2010-09-23 10:34:04 +02:00
|
|
|
aspects of your environment. Including the creator name in the pattern keeps
|
|
|
|
users rigidly separated from each others repos, and is good for a largely
|
|
|
|
autonomous collection of users with a high probability of repo name clashes.
|
|
|
|
|
|
|
|
Omitting the creator name from the pattern puts the repos in a common
|
|
|
|
namespace, and is suitable for environments where it is not very important to
|
|
|
|
keep track of who actually created the repo (except for granting access), but
|
|
|
|
needs more communication / co-operation among the users to avoid repo name
|
|
|
|
clashes.
|
2009-12-06 07:11:02 +01:00
|
|
|
|
2011-11-01 06:03:20 +01:00
|
|
|
### wildcard repos with creator name in them
|
2009-12-06 07:11:02 +01:00
|
|
|
|
|
|
|
Here's an example snippet:
|
|
|
|
|
|
|
|
@prof = u1
|
|
|
|
@TAs = u2 u3
|
|
|
|
@students = u4 u5 u6
|
|
|
|
|
2010-04-25 19:09:27 +02:00
|
|
|
repo assignments/CREATOR/a[0-9][0-9]
|
2009-12-06 07:11:02 +01:00
|
|
|
C = @students
|
2010-04-25 19:09:27 +02:00
|
|
|
RW+ = CREATOR
|
2009-12-06 07:11:02 +01:00
|
|
|
RW = WRITERS @TAs
|
|
|
|
R = READERS @prof
|
|
|
|
|
2011-10-13 14:04:02 +02:00
|
|
|
Note the "C" permission. This is a standalone "C", which gives the named
|
|
|
|
users the right to *create a repo*. <font color="gray">This is not to be
|
|
|
|
confused with the "RWC" or its variants described elsewhere, which are about
|
|
|
|
*branches*, not *repos*.</font>
|
|
|
|
|
2009-12-06 07:11:02 +01:00
|
|
|
For now, ignore the special usernames READERS and WRITERS, and just create a
|
|
|
|
new repo, as user "u4" (a student):
|
|
|
|
|
|
|
|
$ git clone git@server:assignments/u4/a12
|
|
|
|
Initialized empty Git repository in /home/sitaram/t/a12/.git/
|
|
|
|
Initialized empty Git repository in /home/gitolite/repositories/assignments/u4/a12.git/
|
|
|
|
warning: You appear to have cloned an empty repository.
|
|
|
|
|
2010-03-28 09:00:02 +02:00
|
|
|
Notice the *two* empty repo inits, and the order in which they occur ;-)
|
2009-12-06 07:11:02 +01:00
|
|
|
|
2011-11-01 06:03:20 +01:00
|
|
|
### wildcard repos without creator name in them
|
2009-12-06 07:11:02 +01:00
|
|
|
|
2010-04-25 19:09:27 +02:00
|
|
|
Here's how the same example would look if you did not want the CREATOR's name
|
2009-12-06 07:11:02 +01:00
|
|
|
to be part of the actual repo name.
|
|
|
|
|
|
|
|
repo assignments/a[0-9][0-9]
|
|
|
|
C = @students
|
2010-04-25 19:09:27 +02:00
|
|
|
RW+ = CREATOR
|
2009-12-06 07:11:02 +01:00
|
|
|
RW = WRITERS @TAs
|
|
|
|
R = READERS @prof
|
|
|
|
|
|
|
|
We haven't changed anything except the repo name pattern. This means that the
|
|
|
|
first student that creates, say, `assignments/a12` becomes the owner.
|
|
|
|
Mistakes (such as claiming a12 instead of a13) need to be rectified by an
|
|
|
|
admin logging on to the back end, though it's not too difficult.
|
|
|
|
|
|
|
|
You could also repace the C line like this:
|
|
|
|
|
|
|
|
C = @TAs
|
|
|
|
|
|
|
|
and have a TA create the repos in advance.
|
|
|
|
|
2009-12-06 16:10:23 +01:00
|
|
|
In either case, they could then use the `setperms` feature to specify which
|
|
|
|
users are "READERS" and which are "WRITERS". See later for details.
|
2009-12-06 07:11:02 +01:00
|
|
|
|
2011-11-01 06:03:20 +01:00
|
|
|
## F=wildregex valid regexes and how they are used
|
2010-05-21 14:23:05 +02:00
|
|
|
|
2010-11-05 11:34:58 +01:00
|
|
|
### side-note: valid regexes
|
|
|
|
|
|
|
|
Due to projects like `gtk+`, the `+` character is now considered a valid
|
|
|
|
character for an *ordinary* repo. Therefore, a pattern like `foo/.+` does not
|
|
|
|
look like a regex to gitolite. Use `foo/..*` if you want that.
|
|
|
|
|
|
|
|
Also, `..*` by itself is not considered a valid repo pattern. Try
|
|
|
|
`[a-zA-Z0-9].*`.
|
|
|
|
|
2010-08-21 13:32:12 +02:00
|
|
|
### side-note: line-anchored regexes
|
2009-12-06 07:11:02 +01:00
|
|
|
|
|
|
|
A regex like
|
|
|
|
|
|
|
|
repo assignments/S[0-9]+/A[0-9]+
|
|
|
|
|
|
|
|
would match `assignments/S02/A37`. It will not match `assignments/S02/ABC`,
|
|
|
|
or `assignments/S02/a37`, obviously.
|
|
|
|
|
|
|
|
But you may be surprised to find that it does not match even
|
|
|
|
`assignments/S02/A37/B99`. This is because internally, gitolite
|
|
|
|
*line-anchors* the given regex; so that regex actually becomes
|
|
|
|
`^assignments/S[0-9]+/A[0-9]+$` -- notice the line beginning and ending
|
|
|
|
metacharacters.
|
|
|
|
|
2010-08-21 13:32:12 +02:00
|
|
|
#### contrast with refexes
|
2009-12-06 07:11:02 +01:00
|
|
|
|
|
|
|
Just for interest, note that this is in contrast to the refexes for the normal
|
2011-01-27 14:57:36 +01:00
|
|
|
"branch" permissions, as described in `doc/gitolite.conf.mkd` and elsewhere.
|
2010-04-13 19:36:40 +02:00
|
|
|
These "refexes" are only anchored at the start; a pattern like
|
|
|
|
`refs/heads/master` actually can match `refs/heads/master01/bar` as well, even
|
|
|
|
if no one will actually push such a branch! You can anchor both sides if you
|
|
|
|
really care, by using `master$` instead of `master`, but that is *not* the
|
|
|
|
default for refexes.
|
2009-12-06 07:11:02 +01:00
|
|
|
|
2011-11-01 06:03:20 +01:00
|
|
|
## F=setperms handing out rights to wildcard-matched repos
|
2009-12-06 07:11:02 +01:00
|
|
|
|
|
|
|
In the examples above, we saw two special "user" names: READERS and WRITERS.
|
|
|
|
The permissions they have are controlled by the config file, but ***who is
|
|
|
|
part of this list*** is controlled by the person who created the repository.
|
|
|
|
|
|
|
|
The use case is that, although our toy example has only 3 students, in reality
|
|
|
|
there will be a few dozen, but each assignment will be worked on only by a
|
2010-04-25 19:09:27 +02:00
|
|
|
handful from among those. This allows the creator to take ad hoc sets of
|
2011-10-29 02:29:03 +02:00
|
|
|
users from among the actual users in the system, and give them one of two
|
|
|
|
roles (in this example, READERS and WRITERS respectively). In theory you
|
|
|
|
could do the same thing by creating lots of little "assignment-NN" groups in
|
|
|
|
the config file but that may be a little too cumbersome for non-secret
|
custom perm categories in setperms (WARNING: PLEASE READ FULL COMMIT MESSAGE)
THE COMPILED CONFIG FILE FORMAT CHANGES WITH THIS VERSION. PLEASE DO
NOT MIX VERSIONS OR DOWNGRADE. Upgrading using normal gitolite upgrade
means should be fine, though.
Originally, we only allowed "R" and "RW" as categories of users supplied
to the `setperms` command. These map respectively to "READERS" and
"WRITERS" in the access rules.
Now:
- we prefer READERS instead of R and WRITERS instead of RW
- we allow the admin to define other categories as she wishes
(example: MANAGERS, TESTERS, etc). These do not have abbreviations,
however, so they must be supplied in full.
PLEASE, *PLEASE*, read the section in doc/wildcard-repositories.mkd for
more info. This is a VERY powerful feature and if you're not careful
you could mess up the ACLs nicely.
Backward compat note: you can continue to use the "R" and "RW"
categories when running the "setperms" command, and gitolite will
internally convert them to READERS and WRITERS categories.
----
implementation notes:
- new RC var called GL_WILDREPOS_PERM_CATS that is a space-sep list of
the allowed categories in a gl-perms file; defaults to "R RW" if not
specified
- wild_repo_rights no longer returns $c, $r, $wC, where $r = $user if
"R $user", $r = '@all' if "R @all", and similarly with $w and "RW".
Instead it returns $c and a new hash that effectively gives the same
info, but expanded to include any other valid categories (listed in
GL_WILDREPOS_PERM_CATS)
- consequently, the arguments that parse_acl takes also change the
same way
- (side note: R and RW are quietly converted to READERS and WRITERS;
however, new categories that you define yourself do not have
abbreviations)
- setperms validates perms to make sure only allowed categories are
used; however even if someone changed them behind the scenes,
wild_repo_rights will also check. This is necessary in case the
admin tightened up GL_WILDREPOS_PERM_CATS after someone had already
setperms-d his repos.
- as a bonus, we eliminate all the post-Dumper shenanigans, at least
for READERS and WRITERS. Those two now look, to the compile script,
just like any other usernames.
2010-11-06 06:16:17 +01:00
|
|
|
environments.
|
2009-12-06 07:11:02 +01:00
|
|
|
|
|
|
|
Create a small text file that contains the permissions you desire:
|
|
|
|
|
|
|
|
$ cat > myperms
|
custom perm categories in setperms (WARNING: PLEASE READ FULL COMMIT MESSAGE)
THE COMPILED CONFIG FILE FORMAT CHANGES WITH THIS VERSION. PLEASE DO
NOT MIX VERSIONS OR DOWNGRADE. Upgrading using normal gitolite upgrade
means should be fine, though.
Originally, we only allowed "R" and "RW" as categories of users supplied
to the `setperms` command. These map respectively to "READERS" and
"WRITERS" in the access rules.
Now:
- we prefer READERS instead of R and WRITERS instead of RW
- we allow the admin to define other categories as she wishes
(example: MANAGERS, TESTERS, etc). These do not have abbreviations,
however, so they must be supplied in full.
PLEASE, *PLEASE*, read the section in doc/wildcard-repositories.mkd for
more info. This is a VERY powerful feature and if you're not careful
you could mess up the ACLs nicely.
Backward compat note: you can continue to use the "R" and "RW"
categories when running the "setperms" command, and gitolite will
internally convert them to READERS and WRITERS categories.
----
implementation notes:
- new RC var called GL_WILDREPOS_PERM_CATS that is a space-sep list of
the allowed categories in a gl-perms file; defaults to "R RW" if not
specified
- wild_repo_rights no longer returns $c, $r, $wC, where $r = $user if
"R $user", $r = '@all' if "R @all", and similarly with $w and "RW".
Instead it returns $c and a new hash that effectively gives the same
info, but expanded to include any other valid categories (listed in
GL_WILDREPOS_PERM_CATS)
- consequently, the arguments that parse_acl takes also change the
same way
- (side note: R and RW are quietly converted to READERS and WRITERS;
however, new categories that you define yourself do not have
abbreviations)
- setperms validates perms to make sure only allowed categories are
used; however even if someone changed them behind the scenes,
wild_repo_rights will also check. This is necessary in case the
admin tightened up GL_WILDREPOS_PERM_CATS after someone had already
setperms-d his repos.
- as a bonus, we eliminate all the post-Dumper shenanigans, at least
for READERS and WRITERS. Those two now look, to the compile script,
just like any other usernames.
2010-11-06 06:16:17 +01:00
|
|
|
READERS u5
|
|
|
|
WRITERS u6
|
2009-12-06 07:11:02 +01:00
|
|
|
(hit ctrl-d here)
|
|
|
|
|
2011-11-01 06:03:20 +01:00
|
|
|
...and use the new **setperms** command to set permissions for your repo:
|
2009-12-06 07:11:02 +01:00
|
|
|
|
2009-12-06 10:56:53 +01:00
|
|
|
$ ssh git@server setperms assignments/u4/a12 < myperms
|
2009-12-06 07:11:02 +01:00
|
|
|
New perms are:
|
custom perm categories in setperms (WARNING: PLEASE READ FULL COMMIT MESSAGE)
THE COMPILED CONFIG FILE FORMAT CHANGES WITH THIS VERSION. PLEASE DO
NOT MIX VERSIONS OR DOWNGRADE. Upgrading using normal gitolite upgrade
means should be fine, though.
Originally, we only allowed "R" and "RW" as categories of users supplied
to the `setperms` command. These map respectively to "READERS" and
"WRITERS" in the access rules.
Now:
- we prefer READERS instead of R and WRITERS instead of RW
- we allow the admin to define other categories as she wishes
(example: MANAGERS, TESTERS, etc). These do not have abbreviations,
however, so they must be supplied in full.
PLEASE, *PLEASE*, read the section in doc/wildcard-repositories.mkd for
more info. This is a VERY powerful feature and if you're not careful
you could mess up the ACLs nicely.
Backward compat note: you can continue to use the "R" and "RW"
categories when running the "setperms" command, and gitolite will
internally convert them to READERS and WRITERS categories.
----
implementation notes:
- new RC var called GL_WILDREPOS_PERM_CATS that is a space-sep list of
the allowed categories in a gl-perms file; defaults to "R RW" if not
specified
- wild_repo_rights no longer returns $c, $r, $wC, where $r = $user if
"R $user", $r = '@all' if "R @all", and similarly with $w and "RW".
Instead it returns $c and a new hash that effectively gives the same
info, but expanded to include any other valid categories (listed in
GL_WILDREPOS_PERM_CATS)
- consequently, the arguments that parse_acl takes also change the
same way
- (side note: R and RW are quietly converted to READERS and WRITERS;
however, new categories that you define yourself do not have
abbreviations)
- setperms validates perms to make sure only allowed categories are
used; however even if someone changed them behind the scenes,
wild_repo_rights will also check. This is necessary in case the
admin tightened up GL_WILDREPOS_PERM_CATS after someone had already
setperms-d his repos.
- as a bonus, we eliminate all the post-Dumper shenanigans, at least
for READERS and WRITERS. Those two now look, to the compile script,
just like any other usernames.
2010-11-06 06:16:17 +01:00
|
|
|
READERS u5
|
|
|
|
WRITERS u6
|
2009-12-06 07:11:02 +01:00
|
|
|
|
|
|
|
'setperms' will helpfully print what the new permissions are but you can also
|
2011-11-01 06:03:20 +01:00
|
|
|
use **getperms** to check:
|
2009-12-06 07:11:02 +01:00
|
|
|
|
2009-12-06 10:56:53 +01:00
|
|
|
$ ssh git@server getperms assignments/u4/a12
|
custom perm categories in setperms (WARNING: PLEASE READ FULL COMMIT MESSAGE)
THE COMPILED CONFIG FILE FORMAT CHANGES WITH THIS VERSION. PLEASE DO
NOT MIX VERSIONS OR DOWNGRADE. Upgrading using normal gitolite upgrade
means should be fine, though.
Originally, we only allowed "R" and "RW" as categories of users supplied
to the `setperms` command. These map respectively to "READERS" and
"WRITERS" in the access rules.
Now:
- we prefer READERS instead of R and WRITERS instead of RW
- we allow the admin to define other categories as she wishes
(example: MANAGERS, TESTERS, etc). These do not have abbreviations,
however, so they must be supplied in full.
PLEASE, *PLEASE*, read the section in doc/wildcard-repositories.mkd for
more info. This is a VERY powerful feature and if you're not careful
you could mess up the ACLs nicely.
Backward compat note: you can continue to use the "R" and "RW"
categories when running the "setperms" command, and gitolite will
internally convert them to READERS and WRITERS categories.
----
implementation notes:
- new RC var called GL_WILDREPOS_PERM_CATS that is a space-sep list of
the allowed categories in a gl-perms file; defaults to "R RW" if not
specified
- wild_repo_rights no longer returns $c, $r, $wC, where $r = $user if
"R $user", $r = '@all' if "R @all", and similarly with $w and "RW".
Instead it returns $c and a new hash that effectively gives the same
info, but expanded to include any other valid categories (listed in
GL_WILDREPOS_PERM_CATS)
- consequently, the arguments that parse_acl takes also change the
same way
- (side note: R and RW are quietly converted to READERS and WRITERS;
however, new categories that you define yourself do not have
abbreviations)
- setperms validates perms to make sure only allowed categories are
used; however even if someone changed them behind the scenes,
wild_repo_rights will also check. This is necessary in case the
admin tightened up GL_WILDREPOS_PERM_CATS after someone had already
setperms-d his repos.
- as a bonus, we eliminate all the post-Dumper shenanigans, at least
for READERS and WRITERS. Those two now look, to the compile script,
just like any other usernames.
2010-11-06 06:16:17 +01:00
|
|
|
READERS u5
|
|
|
|
WRITERS u6
|
2009-12-06 07:11:02 +01:00
|
|
|
|
|
|
|
The following points are important:
|
|
|
|
|
2011-10-13 14:04:02 +02:00
|
|
|
* note the syntax of the command; it's not a "git" command, and there's no
|
|
|
|
`:` like in a repo URL.
|
|
|
|
* for the actual text being sent in via STDIN, the first space-separated
|
|
|
|
word is the role (in this example, READERS or WRITERS), and the rest
|
|
|
|
are simple usernames.
|
custom perm categories in setperms (WARNING: PLEASE READ FULL COMMIT MESSAGE)
THE COMPILED CONFIG FILE FORMAT CHANGES WITH THIS VERSION. PLEASE DO
NOT MIX VERSIONS OR DOWNGRADE. Upgrading using normal gitolite upgrade
means should be fine, though.
Originally, we only allowed "R" and "RW" as categories of users supplied
to the `setperms` command. These map respectively to "READERS" and
"WRITERS" in the access rules.
Now:
- we prefer READERS instead of R and WRITERS instead of RW
- we allow the admin to define other categories as she wishes
(example: MANAGERS, TESTERS, etc). These do not have abbreviations,
however, so they must be supplied in full.
PLEASE, *PLEASE*, read the section in doc/wildcard-repositories.mkd for
more info. This is a VERY powerful feature and if you're not careful
you could mess up the ACLs nicely.
Backward compat note: you can continue to use the "R" and "RW"
categories when running the "setperms" command, and gitolite will
internally convert them to READERS and WRITERS categories.
----
implementation notes:
- new RC var called GL_WILDREPOS_PERM_CATS that is a space-sep list of
the allowed categories in a gl-perms file; defaults to "R RW" if not
specified
- wild_repo_rights no longer returns $c, $r, $wC, where $r = $user if
"R $user", $r = '@all' if "R @all", and similarly with $w and "RW".
Instead it returns $c and a new hash that effectively gives the same
info, but expanded to include any other valid categories (listed in
GL_WILDREPOS_PERM_CATS)
- consequently, the arguments that parse_acl takes also change the
same way
- (side note: R and RW are quietly converted to READERS and WRITERS;
however, new categories that you define yourself do not have
abbreviations)
- setperms validates perms to make sure only allowed categories are
used; however even if someone changed them behind the scenes,
wild_repo_rights will also check. This is necessary in case the
admin tightened up GL_WILDREPOS_PERM_CATS after someone had already
setperms-d his repos.
- as a bonus, we eliminate all the post-Dumper shenanigans, at least
for READERS and WRITERS. Those two now look, to the compile script,
just like any other usernames.
2010-11-06 06:16:17 +01:00
|
|
|
|
2011-10-29 02:29:03 +02:00
|
|
|
### (admin) adding other roles than READERS and WRITERS
|
custom perm categories in setperms (WARNING: PLEASE READ FULL COMMIT MESSAGE)
THE COMPILED CONFIG FILE FORMAT CHANGES WITH THIS VERSION. PLEASE DO
NOT MIX VERSIONS OR DOWNGRADE. Upgrading using normal gitolite upgrade
means should be fine, though.
Originally, we only allowed "R" and "RW" as categories of users supplied
to the `setperms` command. These map respectively to "READERS" and
"WRITERS" in the access rules.
Now:
- we prefer READERS instead of R and WRITERS instead of RW
- we allow the admin to define other categories as she wishes
(example: MANAGERS, TESTERS, etc). These do not have abbreviations,
however, so they must be supplied in full.
PLEASE, *PLEASE*, read the section in doc/wildcard-repositories.mkd for
more info. This is a VERY powerful feature and if you're not careful
you could mess up the ACLs nicely.
Backward compat note: you can continue to use the "R" and "RW"
categories when running the "setperms" command, and gitolite will
internally convert them to READERS and WRITERS categories.
----
implementation notes:
- new RC var called GL_WILDREPOS_PERM_CATS that is a space-sep list of
the allowed categories in a gl-perms file; defaults to "R RW" if not
specified
- wild_repo_rights no longer returns $c, $r, $wC, where $r = $user if
"R $user", $r = '@all' if "R @all", and similarly with $w and "RW".
Instead it returns $c and a new hash that effectively gives the same
info, but expanded to include any other valid categories (listed in
GL_WILDREPOS_PERM_CATS)
- consequently, the arguments that parse_acl takes also change the
same way
- (side note: R and RW are quietly converted to READERS and WRITERS;
however, new categories that you define yourself do not have
abbreviations)
- setperms validates perms to make sure only allowed categories are
used; however even if someone changed them behind the scenes,
wild_repo_rights will also check. This is necessary in case the
admin tightened up GL_WILDREPOS_PERM_CATS after someone had already
setperms-d his repos.
- as a bonus, we eliminate all the post-Dumper shenanigans, at least
for READERS and WRITERS. Those two now look, to the compile script,
just like any other usernames.
2010-11-06 06:16:17 +01:00
|
|
|
|
2011-10-29 02:29:03 +02:00
|
|
|
Let's say your needs are more complex and you need more roles. For example,
|
|
|
|
you might like to have a setup where only a tester can update tags, and only a
|
|
|
|
manager can delete branches:
|
custom perm categories in setperms (WARNING: PLEASE READ FULL COMMIT MESSAGE)
THE COMPILED CONFIG FILE FORMAT CHANGES WITH THIS VERSION. PLEASE DO
NOT MIX VERSIONS OR DOWNGRADE. Upgrading using normal gitolite upgrade
means should be fine, though.
Originally, we only allowed "R" and "RW" as categories of users supplied
to the `setperms` command. These map respectively to "READERS" and
"WRITERS" in the access rules.
Now:
- we prefer READERS instead of R and WRITERS instead of RW
- we allow the admin to define other categories as she wishes
(example: MANAGERS, TESTERS, etc). These do not have abbreviations,
however, so they must be supplied in full.
PLEASE, *PLEASE*, read the section in doc/wildcard-repositories.mkd for
more info. This is a VERY powerful feature and if you're not careful
you could mess up the ACLs nicely.
Backward compat note: you can continue to use the "R" and "RW"
categories when running the "setperms" command, and gitolite will
internally convert them to READERS and WRITERS categories.
----
implementation notes:
- new RC var called GL_WILDREPOS_PERM_CATS that is a space-sep list of
the allowed categories in a gl-perms file; defaults to "R RW" if not
specified
- wild_repo_rights no longer returns $c, $r, $wC, where $r = $user if
"R $user", $r = '@all' if "R @all", and similarly with $w and "RW".
Instead it returns $c and a new hash that effectively gives the same
info, but expanded to include any other valid categories (listed in
GL_WILDREPOS_PERM_CATS)
- consequently, the arguments that parse_acl takes also change the
same way
- (side note: R and RW are quietly converted to READERS and WRITERS;
however, new categories that you define yourself do not have
abbreviations)
- setperms validates perms to make sure only allowed categories are
used; however even if someone changed them behind the scenes,
wild_repo_rights will also check. This is necessary in case the
admin tightened up GL_WILDREPOS_PERM_CATS after someone had already
setperms-d his repos.
- as a bonus, we eliminate all the post-Dumper shenanigans, at least
for READERS and WRITERS. Those two now look, to the compile script,
just like any other usernames.
2010-11-06 06:16:17 +01:00
|
|
|
|
|
|
|
repo foo/..*
|
|
|
|
C = u1
|
|
|
|
RW refs/tags/ = TESTERS
|
|
|
|
- refs/tags/ = @all
|
|
|
|
RW+ = WRITERS
|
|
|
|
RW = INTERNS
|
|
|
|
R = READERS
|
|
|
|
RW+D = MANAGERS
|
2009-12-06 07:11:02 +01:00
|
|
|
|
custom perm categories in setperms (WARNING: PLEASE READ FULL COMMIT MESSAGE)
THE COMPILED CONFIG FILE FORMAT CHANGES WITH THIS VERSION. PLEASE DO
NOT MIX VERSIONS OR DOWNGRADE. Upgrading using normal gitolite upgrade
means should be fine, though.
Originally, we only allowed "R" and "RW" as categories of users supplied
to the `setperms` command. These map respectively to "READERS" and
"WRITERS" in the access rules.
Now:
- we prefer READERS instead of R and WRITERS instead of RW
- we allow the admin to define other categories as she wishes
(example: MANAGERS, TESTERS, etc). These do not have abbreviations,
however, so they must be supplied in full.
PLEASE, *PLEASE*, read the section in doc/wildcard-repositories.mkd for
more info. This is a VERY powerful feature and if you're not careful
you could mess up the ACLs nicely.
Backward compat note: you can continue to use the "R" and "RW"
categories when running the "setperms" command, and gitolite will
internally convert them to READERS and WRITERS categories.
----
implementation notes:
- new RC var called GL_WILDREPOS_PERM_CATS that is a space-sep list of
the allowed categories in a gl-perms file; defaults to "R RW" if not
specified
- wild_repo_rights no longer returns $c, $r, $wC, where $r = $user if
"R $user", $r = '@all' if "R @all", and similarly with $w and "RW".
Instead it returns $c and a new hash that effectively gives the same
info, but expanded to include any other valid categories (listed in
GL_WILDREPOS_PERM_CATS)
- consequently, the arguments that parse_acl takes also change the
same way
- (side note: R and RW are quietly converted to READERS and WRITERS;
however, new categories that you define yourself do not have
abbreviations)
- setperms validates perms to make sure only allowed categories are
used; however even if someone changed them behind the scenes,
wild_repo_rights will also check. This is necessary in case the
admin tightened up GL_WILDREPOS_PERM_CATS after someone had already
setperms-d his repos.
- as a bonus, we eliminate all the post-Dumper shenanigans, at least
for READERS and WRITERS. Those two now look, to the compile script,
just like any other usernames.
2010-11-06 06:16:17 +01:00
|
|
|
As you can see, someone pre-creates the repo and assigns rights to various
|
|
|
|
people, say by sending something like this to `setperms`:
|
|
|
|
|
|
|
|
READERS wally
|
|
|
|
WRITERS dilbert alice
|
|
|
|
MANAGERS phb
|
|
|
|
INTERNS ashok
|
|
|
|
TESTERS ashok
|
|
|
|
|
2011-01-27 14:57:36 +01:00
|
|
|
You can enable this by setting the `GL_WILDREPOS_PERM_CATS` variable in the rc
|
|
|
|
file. The rc file documentation (`doc/gitolite.rc.mkd`) explains how.
|
custom perm categories in setperms (WARNING: PLEASE READ FULL COMMIT MESSAGE)
THE COMPILED CONFIG FILE FORMAT CHANGES WITH THIS VERSION. PLEASE DO
NOT MIX VERSIONS OR DOWNGRADE. Upgrading using normal gitolite upgrade
means should be fine, though.
Originally, we only allowed "R" and "RW" as categories of users supplied
to the `setperms` command. These map respectively to "READERS" and
"WRITERS" in the access rules.
Now:
- we prefer READERS instead of R and WRITERS instead of RW
- we allow the admin to define other categories as she wishes
(example: MANAGERS, TESTERS, etc). These do not have abbreviations,
however, so they must be supplied in full.
PLEASE, *PLEASE*, read the section in doc/wildcard-repositories.mkd for
more info. This is a VERY powerful feature and if you're not careful
you could mess up the ACLs nicely.
Backward compat note: you can continue to use the "R" and "RW"
categories when running the "setperms" command, and gitolite will
internally convert them to READERS and WRITERS categories.
----
implementation notes:
- new RC var called GL_WILDREPOS_PERM_CATS that is a space-sep list of
the allowed categories in a gl-perms file; defaults to "R RW" if not
specified
- wild_repo_rights no longer returns $c, $r, $wC, where $r = $user if
"R $user", $r = '@all' if "R @all", and similarly with $w and "RW".
Instead it returns $c and a new hash that effectively gives the same
info, but expanded to include any other valid categories (listed in
GL_WILDREPOS_PERM_CATS)
- consequently, the arguments that parse_acl takes also change the
same way
- (side note: R and RW are quietly converted to READERS and WRITERS;
however, new categories that you define yourself do not have
abbreviations)
- setperms validates perms to make sure only allowed categories are
used; however even if someone changed them behind the scenes,
wild_repo_rights will also check. This is necessary in case the
admin tightened up GL_WILDREPOS_PERM_CATS after someone had already
setperms-d his repos.
- as a bonus, we eliminate all the post-Dumper shenanigans, at least
for READERS and WRITERS. Those two now look, to the compile script,
just like any other usernames.
2010-11-06 06:16:17 +01:00
|
|
|
|
2011-11-01 06:03:20 +01:00
|
|
|
#### #rolenamewarn **IMPORTANT WARNING ABOUT THIS FEATURE**
|
custom perm categories in setperms (WARNING: PLEASE READ FULL COMMIT MESSAGE)
THE COMPILED CONFIG FILE FORMAT CHANGES WITH THIS VERSION. PLEASE DO
NOT MIX VERSIONS OR DOWNGRADE. Upgrading using normal gitolite upgrade
means should be fine, though.
Originally, we only allowed "R" and "RW" as categories of users supplied
to the `setperms` command. These map respectively to "READERS" and
"WRITERS" in the access rules.
Now:
- we prefer READERS instead of R and WRITERS instead of RW
- we allow the admin to define other categories as she wishes
(example: MANAGERS, TESTERS, etc). These do not have abbreviations,
however, so they must be supplied in full.
PLEASE, *PLEASE*, read the section in doc/wildcard-repositories.mkd for
more info. This is a VERY powerful feature and if you're not careful
you could mess up the ACLs nicely.
Backward compat note: you can continue to use the "R" and "RW"
categories when running the "setperms" command, and gitolite will
internally convert them to READERS and WRITERS categories.
----
implementation notes:
- new RC var called GL_WILDREPOS_PERM_CATS that is a space-sep list of
the allowed categories in a gl-perms file; defaults to "R RW" if not
specified
- wild_repo_rights no longer returns $c, $r, $wC, where $r = $user if
"R $user", $r = '@all' if "R @all", and similarly with $w and "RW".
Instead it returns $c and a new hash that effectively gives the same
info, but expanded to include any other valid categories (listed in
GL_WILDREPOS_PERM_CATS)
- consequently, the arguments that parse_acl takes also change the
same way
- (side note: R and RW are quietly converted to READERS and WRITERS;
however, new categories that you define yourself do not have
abbreviations)
- setperms validates perms to make sure only allowed categories are
used; however even if someone changed them behind the scenes,
wild_repo_rights will also check. This is necessary in case the
admin tightened up GL_WILDREPOS_PERM_CATS after someone had already
setperms-d his repos.
- as a bonus, we eliminate all the post-Dumper shenanigans, at least
for READERS and WRITERS. Those two now look, to the compile script,
just like any other usernames.
2010-11-06 06:16:17 +01:00
|
|
|
|
2011-10-29 02:29:03 +02:00
|
|
|
Please make sure that none of the role names conflict with any of the
|
custom perm categories in setperms (WARNING: PLEASE READ FULL COMMIT MESSAGE)
THE COMPILED CONFIG FILE FORMAT CHANGES WITH THIS VERSION. PLEASE DO
NOT MIX VERSIONS OR DOWNGRADE. Upgrading using normal gitolite upgrade
means should be fine, though.
Originally, we only allowed "R" and "RW" as categories of users supplied
to the `setperms` command. These map respectively to "READERS" and
"WRITERS" in the access rules.
Now:
- we prefer READERS instead of R and WRITERS instead of RW
- we allow the admin to define other categories as she wishes
(example: MANAGERS, TESTERS, etc). These do not have abbreviations,
however, so they must be supplied in full.
PLEASE, *PLEASE*, read the section in doc/wildcard-repositories.mkd for
more info. This is a VERY powerful feature and if you're not careful
you could mess up the ACLs nicely.
Backward compat note: you can continue to use the "R" and "RW"
categories when running the "setperms" command, and gitolite will
internally convert them to READERS and WRITERS categories.
----
implementation notes:
- new RC var called GL_WILDREPOS_PERM_CATS that is a space-sep list of
the allowed categories in a gl-perms file; defaults to "R RW" if not
specified
- wild_repo_rights no longer returns $c, $r, $wC, where $r = $user if
"R $user", $r = '@all' if "R @all", and similarly with $w and "RW".
Instead it returns $c and a new hash that effectively gives the same
info, but expanded to include any other valid categories (listed in
GL_WILDREPOS_PERM_CATS)
- consequently, the arguments that parse_acl takes also change the
same way
- (side note: R and RW are quietly converted to READERS and WRITERS;
however, new categories that you define yourself do not have
abbreviations)
- setperms validates perms to make sure only allowed categories are
used; however even if someone changed them behind the scenes,
wild_repo_rights will also check. This is necessary in case the
admin tightened up GL_WILDREPOS_PERM_CATS after someone had already
setperms-d his repos.
- as a bonus, we eliminate all the post-Dumper shenanigans, at least
for READERS and WRITERS. Those two now look, to the compile script,
just like any other usernames.
2010-11-06 06:16:17 +01:00
|
|
|
**usernames** in the system. For example, if you have a user called "foo",
|
2011-10-29 02:29:03 +02:00
|
|
|
make sure you do not include "foo" as a valid role in
|
custom perm categories in setperms (WARNING: PLEASE READ FULL COMMIT MESSAGE)
THE COMPILED CONFIG FILE FORMAT CHANGES WITH THIS VERSION. PLEASE DO
NOT MIX VERSIONS OR DOWNGRADE. Upgrading using normal gitolite upgrade
means should be fine, though.
Originally, we only allowed "R" and "RW" as categories of users supplied
to the `setperms` command. These map respectively to "READERS" and
"WRITERS" in the access rules.
Now:
- we prefer READERS instead of R and WRITERS instead of RW
- we allow the admin to define other categories as she wishes
(example: MANAGERS, TESTERS, etc). These do not have abbreviations,
however, so they must be supplied in full.
PLEASE, *PLEASE*, read the section in doc/wildcard-repositories.mkd for
more info. This is a VERY powerful feature and if you're not careful
you could mess up the ACLs nicely.
Backward compat note: you can continue to use the "R" and "RW"
categories when running the "setperms" command, and gitolite will
internally convert them to READERS and WRITERS categories.
----
implementation notes:
- new RC var called GL_WILDREPOS_PERM_CATS that is a space-sep list of
the allowed categories in a gl-perms file; defaults to "R RW" if not
specified
- wild_repo_rights no longer returns $c, $r, $wC, where $r = $user if
"R $user", $r = '@all' if "R @all", and similarly with $w and "RW".
Instead it returns $c and a new hash that effectively gives the same
info, but expanded to include any other valid categories (listed in
GL_WILDREPOS_PERM_CATS)
- consequently, the arguments that parse_acl takes also change the
same way
- (side note: R and RW are quietly converted to READERS and WRITERS;
however, new categories that you define yourself do not have
abbreviations)
- setperms validates perms to make sure only allowed categories are
used; however even if someone changed them behind the scenes,
wild_repo_rights will also check. This is necessary in case the
admin tightened up GL_WILDREPOS_PERM_CATS after someone had already
setperms-d his repos.
- as a bonus, we eliminate all the post-Dumper shenanigans, at least
for READERS and WRITERS. Those two now look, to the compile script,
just like any other usernames.
2010-11-06 06:16:17 +01:00
|
|
|
`$GL_WILDREPOS_PERM_CATS`.
|
|
|
|
|
2011-10-29 02:29:03 +02:00
|
|
|
You can keep things sane by using UPPERCASE names for roles, while keeping all
|
|
|
|
your usernames lowercase; then you don't have to worry about this problem.
|
2009-12-06 07:11:02 +01:00
|
|
|
|
2011-11-01 06:03:20 +01:00
|
|
|
## setting a gitweb description for a wildcard-matched repo
|
2010-02-05 11:30:47 +01:00
|
|
|
|
2011-11-01 06:03:20 +01:00
|
|
|
Similar to the getperms/setperms commands, there are the
|
|
|
|
[getdesc/setdesc][setdesc] commands, thanks to Teemu.
|
2010-05-21 14:23:05 +02:00
|
|
|
|
2011-11-01 06:03:20 +01:00
|
|
|
## reporting
|
2009-12-06 07:11:02 +01:00
|
|
|
|
2010-08-21 13:32:12 +02:00
|
|
|
In order to see what repositories were created from a wildcard, use the
|
2011-11-01 06:03:20 +01:00
|
|
|
["expand"][expand] command.
|
2009-12-06 07:11:02 +01:00
|
|
|
|
2011-11-01 06:03:20 +01:00
|
|
|
## deleting a wild repo
|
2011-05-05 06:01:29 +02:00
|
|
|
|
2011-11-01 06:03:20 +01:00
|
|
|
See [repo deletion][wild_repodel] for more on this. Note that this requires you
|
|
|
|
to install/setup "adc"s (admin defined commands). See
|
|
|
|
[admin-defined-commands][ADCs] for how to do that.
|
2010-12-24 06:31:28 +01:00
|
|
|
|
2011-11-01 06:03:20 +01:00
|
|
|
----
|
2010-12-24 06:31:28 +01:00
|
|
|
|
2011-11-01 06:03:20 +01:00
|
|
|
Enjoy, and please use with care. This is pretty powerful stuff. As they say:
|
|
|
|
if you break it, you get to keep both pieces :)
|
2010-05-21 14:23:05 +02:00
|
|
|
|
2011-11-05 02:13:26 +01:00
|
|
|
## F=wildhow__ how it actually works
|
2010-03-28 09:00:02 +02:00
|
|
|
|
|
|
|
This section tells you what is happening inside gitolite so you can understand
|
|
|
|
this feature better. Let's use the config example at the beginning of this
|
|
|
|
document:
|
|
|
|
|
2010-04-25 19:09:27 +02:00
|
|
|
repo assignments/CREATOR/a[0-9][0-9]
|
2010-03-28 09:00:02 +02:00
|
|
|
C = @students
|
2010-04-25 19:09:27 +02:00
|
|
|
RW+ = CREATOR
|
2010-03-28 09:00:02 +02:00
|
|
|
RW = WRITERS @TAs
|
|
|
|
R = READERS @prof
|
|
|
|
|
|
|
|
First we find the set of rules to apply. This involves replacing the special
|
2010-04-25 19:09:27 +02:00
|
|
|
words CREATOR, WRITERS, and READERS with appropriate usernames to derive an
|
2010-03-28 09:00:02 +02:00
|
|
|
"effective" ruleset for the repo in question.
|
|
|
|
|
2010-04-25 19:09:27 +02:00
|
|
|
For a **new** repo, replace the word CREATOR in all repo patterns and rules
|
2010-03-28 09:00:02 +02:00
|
|
|
with the name of the invoking user.
|
|
|
|
|
2010-04-25 19:09:27 +02:00
|
|
|
> (Note: this is why you should never use `C = CREATOR`; it becomes `C =
|
2010-03-28 09:00:02 +02:00
|
|
|
> invoking_user`! Unless you really want to allow *all* users to create
|
|
|
|
> repos, you should restrict "C" perms to an actual user or set of users,
|
|
|
|
> like in the examples in this document).
|
|
|
|
|
|
|
|
For an **existing** repo, do the same but replace with the name of the user
|
|
|
|
who actually *created* the repo (this name is recorded in a special file in
|
|
|
|
the repo directory when the repo is first created, so it is available).
|
|
|
|
|
|
|
|
Now find a repo pattern that matches the actual reponame being pushed -- this
|
2010-09-23 10:34:04 +02:00
|
|
|
tells you which set of rules to apply. There can be multiple matches; if so,
|
|
|
|
they will all be applied in the sequence they appear in the config file.
|
2010-03-28 09:00:02 +02:00
|
|
|
|
2011-10-29 02:29:03 +02:00
|
|
|
If the invoking user has been given the "WRITERS" role using `setperms`, all
|
custom perm categories in setperms (WARNING: PLEASE READ FULL COMMIT MESSAGE)
THE COMPILED CONFIG FILE FORMAT CHANGES WITH THIS VERSION. PLEASE DO
NOT MIX VERSIONS OR DOWNGRADE. Upgrading using normal gitolite upgrade
means should be fine, though.
Originally, we only allowed "R" and "RW" as categories of users supplied
to the `setperms` command. These map respectively to "READERS" and
"WRITERS" in the access rules.
Now:
- we prefer READERS instead of R and WRITERS instead of RW
- we allow the admin to define other categories as she wishes
(example: MANAGERS, TESTERS, etc). These do not have abbreviations,
however, so they must be supplied in full.
PLEASE, *PLEASE*, read the section in doc/wildcard-repositories.mkd for
more info. This is a VERY powerful feature and if you're not careful
you could mess up the ACLs nicely.
Backward compat note: you can continue to use the "R" and "RW"
categories when running the "setperms" command, and gitolite will
internally convert them to READERS and WRITERS categories.
----
implementation notes:
- new RC var called GL_WILDREPOS_PERM_CATS that is a space-sep list of
the allowed categories in a gl-perms file; defaults to "R RW" if not
specified
- wild_repo_rights no longer returns $c, $r, $wC, where $r = $user if
"R $user", $r = '@all' if "R @all", and similarly with $w and "RW".
Instead it returns $c and a new hash that effectively gives the same
info, but expanded to include any other valid categories (listed in
GL_WILDREPOS_PERM_CATS)
- consequently, the arguments that parse_acl takes also change the
same way
- (side note: R and RW are quietly converted to READERS and WRITERS;
however, new categories that you define yourself do not have
abbreviations)
- setperms validates perms to make sure only allowed categories are
used; however even if someone changed them behind the scenes,
wild_repo_rights will also check. This is necessary in case the
admin tightened up GL_WILDREPOS_PERM_CATS after someone had already
setperms-d his repos.
- as a bonus, we eliminate all the post-Dumper shenanigans, at least
for READERS and WRITERS. Those two now look, to the compile script,
just like any other usernames.
2010-11-06 06:16:17 +01:00
|
|
|
permissions for the the user WRITERS are given to the invoking username (and
|
|
|
|
similarly for READERS).
|
2010-03-28 09:00:02 +02:00
|
|
|
|
|
|
|
At this point we have an effective ruleset, and the normal access rules (R,
|
|
|
|
RW, etc) apply, with the addition that the invoking user needs "C" access to
|
|
|
|
be able to create a repo.
|
|
|
|
|
2010-04-25 19:09:27 +02:00
|
|
|
> (Note: "C" rights do not automatically give the CREATOR any other rights;
|
|
|
|
> they must be specifically given. `RW+ = CREATOR` is recommended in most
|
2010-03-28 09:00:02 +02:00
|
|
|
> situations, as you can see in our example).
|
|
|
|
|
|
|
|
Assuming user "u4" trying to push-create a new repo called
|
custom perm categories in setperms (WARNING: PLEASE READ FULL COMMIT MESSAGE)
THE COMPILED CONFIG FILE FORMAT CHANGES WITH THIS VERSION. PLEASE DO
NOT MIX VERSIONS OR DOWNGRADE. Upgrading using normal gitolite upgrade
means should be fine, though.
Originally, we only allowed "R" and "RW" as categories of users supplied
to the `setperms` command. These map respectively to "READERS" and
"WRITERS" in the access rules.
Now:
- we prefer READERS instead of R and WRITERS instead of RW
- we allow the admin to define other categories as she wishes
(example: MANAGERS, TESTERS, etc). These do not have abbreviations,
however, so they must be supplied in full.
PLEASE, *PLEASE*, read the section in doc/wildcard-repositories.mkd for
more info. This is a VERY powerful feature and if you're not careful
you could mess up the ACLs nicely.
Backward compat note: you can continue to use the "R" and "RW"
categories when running the "setperms" command, and gitolite will
internally convert them to READERS and WRITERS categories.
----
implementation notes:
- new RC var called GL_WILDREPOS_PERM_CATS that is a space-sep list of
the allowed categories in a gl-perms file; defaults to "R RW" if not
specified
- wild_repo_rights no longer returns $c, $r, $wC, where $r = $user if
"R $user", $r = '@all' if "R @all", and similarly with $w and "RW".
Instead it returns $c and a new hash that effectively gives the same
info, but expanded to include any other valid categories (listed in
GL_WILDREPOS_PERM_CATS)
- consequently, the arguments that parse_acl takes also change the
same way
- (side note: R and RW are quietly converted to READERS and WRITERS;
however, new categories that you define yourself do not have
abbreviations)
- setperms validates perms to make sure only allowed categories are
used; however even if someone changed them behind the scenes,
wild_repo_rights will also check. This is necessary in case the
admin tightened up GL_WILDREPOS_PERM_CATS after someone had already
setperms-d his repos.
- as a bonus, we eliminate all the post-Dumper shenanigans, at least
for READERS and WRITERS. Those two now look, to the compile script,
just like any other usernames.
2010-11-06 06:16:17 +01:00
|
|
|
`assignments/u4/a23`, this is what the effective ruleset looks like:
|
2010-03-28 09:00:02 +02:00
|
|
|
|
|
|
|
repo assignments/u4/a23
|
|
|
|
C = @students
|
|
|
|
RW+ = u4
|
|
|
|
RW = @TAs
|
|
|
|
R = @prof
|
|
|
|
|
2011-10-29 02:29:03 +02:00
|
|
|
If u4 gives u5 the "WRITERS" role using `setperms`, and u5 tries to access
|
|
|
|
that repo, the ruleset looks like:
|
2010-03-28 09:00:02 +02:00
|
|
|
|
|
|
|
repo assignments/u4/a23
|
|
|
|
C = @students
|
|
|
|
RW+ = u4
|
|
|
|
RW = u5 @TAs
|
|
|
|
R = @prof
|
|
|
|
|
|
|
|
I hope that helps.
|
|
|
|
|