Pro Git 2nd Edition 2.1.413messages that don’t adhere to your rule. Enforcing a User-Based ACL System Suppose you want to add a mechanism that uses an access control list (ACL) that specifies which users are allowed to push changes to certain subdirectories or specific files. To enforce this, you’ll write those rules to a file named acl that lives in your bare Git repository on the server. You’ll have the update hook look at those rules access to update all those files. The first thing you’ll do is write your ACL. Here you’ll use a format very much like the CVS ACL mechanism: it uses a series of lines, where the first field is avail or0 码力 | 731 页 | 21.49 MB | 1 年前3
Pro Git 2nd Edition 2.1.413that don’t adhere to your rule. Enforcing a User-Based ACL System Suppose you want to add a mechanism that uses an access control list (ACL) that specifies which users are allowed to push changes to certain subdirectories or specific files. To enforce this, you’ll write those rules to a file named acl that lives in your bare Git repository on the server. You’ll have 359 the update hook look at those access to update all those files. The first thing you’ll do is write your ACL. Here you’ll use a format very much like the CVS ACL mechanism: it uses a series of lines, where the first field is avail or0 码力 | 501 页 | 17.96 MB | 1 年前3
Pro Git 2nd Edition 2.1.413 messages that don’t adhere to your rule. Enforcing a User-Based ACL System Suppose you want to add a mechanism that uses an access control list (ACL) that specifies which users are allowed to push changes to certain subdirectories or specific files. To enforce this, you’ll write those rules to a file named acl that lives in your bare Git repository on the server. You’ll have the update hook look at those rules access to update all those files. The first thing you’ll do is write your ACL. Here you’ll use a format very much like the CVS ACL mechanism: it uses a series of lines, where the first field is avail or0 码力 | 691 页 | 13.35 MB | 1 年前3
Pro Git 中文版 第2版 2.1.66--system receive.denyDeletes true 这样会禁止通过推送删除分支和标签 — 没有用户可以这么做。 要删除远程分支,必须从服务器手动删除引用文 件。 通过用户访问控制列表(ACL)也能够在用户级的粒度上实现同样的功能, 你将在 使用强制策略的一个例 子 一节学到具体的做法。 Git 属性 你也可以针对特定的路径配置某些设置项,这样 Git 就只对特定的子目录或子文件集运用它们。 脚本里,所有包含不符合指定规则的提交都会遭到拒绝。 指定基于用户的访问权限控制列表(ACL)系统 假设你需要添加一个使用访问权限控制列表的机制,来指定哪些用户对项目的哪些部分有推送权限。 某些用户 具有全部的访问权,其他人只对某些子目录或者特定的文件具有推送权限。 为了实现这一点,你要把相关的规 则写入位于服务器原始 Git 仓库的 acl 文件中。 你还需要让 update 钩子检阅这些规则,审视推送的提交内容中 钩子检阅这些规则,审视推送的提交内容中 被修改的所有文件,然后决定执行推送的用户是否对所有这些文件都有权限。 357 先从写一个 ACL 文件开始吧。 这里使用的格式和 CVS 的 ACL 机制十分类似:它由若干行构成,第一项内容是 avail 或者 unavail,接着是逗号分隔的适用该规则的用户列表,最后一项是适用该规则的路径(该项空缺表 示没有路径限制)。 各项由管道符 | 隔开。 在本例中,你会有几个管理员,一些对0 码力 | 501 页 | 19.30 MB | 1 年前3
Pro Git 中文版 第2版 2.1.66--system receive.denyDeletes true 这样会禁止通过推送删除分支和标签 — 没有用户可以这么做。 要删除远程分 支,必须从服务器手动删除引用文件。 通过用户访问控制列表(ACL)也能够 在用户级的粒度上实现同样的功能, 你将在 使用强制策略的一个例子 一节学 到具体的做法。 GIT 属性 你也可以针对特定的路径配置某些设置项,这样 Git 就只对特定的子目录或子 脚本里,所有包含不符合指定规则的提交都会遭到拒 绝。 指定基于用户的访问权限控制列表(ACL)系统 假设你需要添加一个使用访问权限控制列表的机制,来指定哪些用户对项目的 哪些部分有推送权限。 某些用户具有全部的访问权,其他人只对某些子目录 或者特定的文件具有推送权限。 为了实现这一点,你要把相关的规则写入位 于服务器原始 Git 仓库的 acl 文件中。 你还需要让 update 钩子检阅这些规 则,审视推 则,审视推送的提交内容中被修改的所有文件,然后决定执行推送的用户是否 对所有这些文件都有权限。 先从写一个 ACL 文件开始吧。 这里使用的格式和 CVS 的 ACL 机制十分类 似:它由若干行构成,第一项内容是 avail 或者 unavail,接着是逗号分隔的 适用该规则的用户列表,最后一项是适用该规则的路径(该项空缺表示没有路 径限制)。 各项由管道符 | 隔开。 在本例中,你会有几个管理员,一些对0 码力 | 670 页 | 13.59 MB | 1 年前3
共 5 条
- 1













