Trac Permissions

Trac使用一种简单但灵活的权限系统来控制什么用户可以或不可以访问。

权限管理使用 trac-admin 工具来管理。

正常的访问者、非认证用户,在访问系统时被赋予缺省角色 (user) 名为 anonymous。 把许可赋给 anonymous用户可以用来为非认证用户/访客设置权限。

除了这些权限,当用户被系统认证或登录到系统中,还可以被赋予额外个别的权力。


Trac uses a simple but flexible permission system to control what users can and can't access.

Permission privilegies are managed using the trac-admin tool.

Regular visitors, non-authenticated users, accessing the system are assigned the default role (user) named anonymous. Assign permissions to the anonymous user to set privilegies for non-authenticated/guest users.

In addition to these privileges users can be granted additional individual rights in effect when authenticated and logged into the system.

Available privileges

  • TRAC_ADMIN
  • LOG_VIEW
  • FILE_VIEW
  • CHANGESET_VIEW
  • BROWSER_VIEW
  • TICKET_VIEW, TICKET_CREATE, TICKET_MODIFY, TICKET_ADMIN
  • REPORT_VIEW, REPORT_CREATE, REPORT_MODIFY, REPORT_DELETE, REPORT_ADMIN, REPORT_SQL_VIEW
  • WIKI_VIEW, WIKI_CREATE, WIKI_MODIFY, WIKI_DELETE, WIKI_ADMIN
  • MILESTONE_VIEW, MILESTONE_CREATE, MILESTONE_MODIFY, MILESTONE_DELETE
  • ROADMAP_VIEW, ROADMAP_ADMIN
  • TIMELINE_VIEW
  • SEARCH_VIEW
  • CONFIG_VIEW

something_ADMIN权限只是一个捷径,可以用来一口气赋予一个用户所有something权限。拥有TRAC_ADMIN权限就象是在*NIX系统中的root,它可以让你做任何想做的事。


The something_ADMIN privileges are just shortcuts that can be used to grant a user all the something privileges in one go. Having TRAC_ADMIN is like being root on a *NIX system, it will let you do anything you want.

Granting privileges

当前惟一的方法给用户授权只有通过使用trac-admin脚本。当前的权限集可以使用下面的命令列出: Currently the only way to grant privileges to users is by using the

  $ trac-admin /path/to/projenv permission list

这个命令将允许用户bob删除报告:

  $ trac-admin /path/to/projenv permission add bob REPORT_DELETE

Currently the only way to grant privileges to users is by using the trac-admin script. The current set of privileges can be listed with the following command:

  $ trac-admin /path/to/projenv permission list

This command will let the user bob delete reports:

  $ trac-admin /path/to/projenv permission add bob REPORT_DELETE

Permission groups

许可可以被组合在一起形成角色,如 developeradmin,等。


Permissions can be grouped together to form roles such as developer, admin, etc.

  $ trac-admin /path/to/projenv permission add developer WIKI_ADMIN
  $ trac-admin /path/to/projenv permission add developer REPORT_ADMIN
  $ trac-admin /path/to/projenv permission add developer TICKET_MODIFY
  $ trac-admin /path/to/projenv permission add bob developer
  $ trac-admin /path/to/projenv permission add john developer

Default permissions

给特殊的用户 'anonymous 赋予权限可以用来控制一个匿名用户在登录之前可以做什么。

同样的方式,权限赋予特殊用户 authenticated 将应用于任何认证(登录)用户。


Granting privileges to the special user anonymous can be used to control what an anonymous user can do before they have logged in.

In the same way, privileges granted to the special user authenticated will apply to any authenticated (logged in) user.


See also: TracAdmin, TracGuide