Pagelist Auth List Short

Summary: Display, in brief format, the permissions settings for pages that have permissions set.
Version: 1.0
Prerequisites:
Status: Mature
Maintainer: Simon
Categories: PageList, MarkupOnly
Users: +1 (view / edit)

Questions answered by this recipe

How do I display page permissions in a brief tabular format?

Description

Display the permissions settings for pages that have permissions set.

Fields that say "(protected)" mean that you may need to log in (e.g., with an administrative password) in order to view them.

Use the following page list template to create a short list of authorisations.

Implementation

Add the following to your Site.LocalTemplates, or create a page such as Site.AuthListShort?.

#authlistshort

Short authorisation list showing page permissions

>>comment<<
[[#authlistshort]]
(:template defaults passwd=?*:)
(:template first:)
(:table class='authlist' cellspacing=0 cellpadding=0 border=0:)

(:template first {=$Group}:)
(:cellnr colspan=8 style='border-top: gray 1px solid;' :)[['''{=$Groupspaced}'''/]]: 
(:if exists {=$Group}.GroupAttributes:)
[[{=$Group}.GroupAttributes]] &nbsp;
[- [[{=$Group}.GroupAttributes?action=attr | (attr)]] -] : 
(:cellnr:)[-''read''-]&nbsp;    
(:cell:)[-{{=$Group}.GroupAttributes$PasswdRead}-]&nbsp;   
(:cell:)[-''edit''-]&nbsp;    
(:cell:)[-{{=$Group}.GroupAttributes$PasswdEdit}-]&nbsp;   
(:cell:)[-''attr''-]&nbsp;    
(:cell:)[-{{=$Group}.GroupAttributes$PasswdAttr}-]&nbsp;   
(:cell:)[-''upload''-]&nbsp;  
(:cell:)[-{{=$Group}.GroupAttributes$PasswdUpload}-] 
(:ifend:)
(:template each:)
(:if ! equal {=$Name} GroupAttributes :)
(:cellnr colspan=8:)
[[{=$FullName}]] &nbsp;
[- [[{=$FullName}?action=attr | (attr) ]] -] : 
(:cellnr:)[-''read''-]&nbsp;    
(:cell:)[-{=$PasswdRead}-]&nbsp; 
(:cell:)[-''edit''-]&nbsp;    
(:cell:)[-{=$PasswdEdit}-]&nbsp; 
(:cell:)[-''attr''-]&nbsp;    
(:cell:)[-{=$PasswdAttr}-]&nbsp; 
(:cell:)[-''upload''-]&nbsp;  
(:cell:)[-{=$PasswdUpload}-]
(:ifend:)
(:template last:)
(:cellnr colspan=8 style='border-top: gray 1px solid;' :)
[-{$$PageCount} pages displayed-]
(:tableend:)
[[#authlistshortend]]
>><<

(:template defaults passwd=?*:) (:template first:)

(:template first {=$Group}:)

{=$Groupspaced}?:

(:template each:)

{=$FullName}?   (attr) :

read  {=$PasswdRead}  edit  {=$PasswdEdit}  attr  {=$PasswdAttr}  upload  {=$PasswdUpload}

(:template last:)

{$$PageCount} pages displayed

Create the pagelist using the following code

>>font-size:small<<

(:pagelist fmt=#authlistshort request=1 count=20 group=PmWiki,Cookbook:)

>><<
Cookbook:

Cookbook.GroupAttributes   (attr) :

read    edit    attr  ****  upload 

Cookbook.AddUrlSchemes   (attr) :

read    edit  ****  attr  (set by group) ****  upload 

Cookbook.AddUrlSchemes-Users   (attr) :

read    edit  ****  attr  (set by group) ****  upload 

Cookbook.Blocklist2   (attr) :

read    edit  ****  attr  ****  upload  ****

Cookbook.Clipboard-Users   (attr) :

read    edit  ****  attr  (set by group) ****  upload 

Cookbook.CommentBoxPlus   (attr) :

read    edit  @nopass  attr  (set by group) ****  upload 

Cookbook.Comments   (attr) :

read    edit  ****  attr  (set by group) ****  upload 

Cookbook.Comments-UseCases   (attr) :

read    edit  ****  attr  ****  upload 

Cookbook.Cookbook   (attr) :

read    edit  ****  attr  (set by group) ****  upload 

Cookbook.DiscussionTab-Users   (attr) :

read    edit  ****  attr  (set by group) ****  upload 

Cookbook.Forum   (attr) :

read    edit  ****  attr  (set by group) ****  upload 

Cookbook.Forum-Users   (attr) :

read    edit  ****  attr  (set by group) ****  upload 

Cookbook.ForumX   (attr) :

read    edit  ****  attr  (set by group) ****  upload 

Cookbook.FoxForum   (attr) :

read    edit  ****  attr  (set by group) ****  upload 

Cookbook.Guestbook   (attr) :

read    edit  ****  attr  (set by group) ****  upload 

Cookbook.Multilanguage-archive   (attr) :

read    edit  ****  attr  (set by group) ****  upload 

Cookbook.SimpleForum   (attr) :

read    edit  ****  attr  (set by group) ****  upload 

Cookbook.SimpleForum-Talk   (attr) :

read    edit  ****  attr  (set by group) ****  upload 

Cookbook.Template-Users   (attr) :

read    edit  ****  attr  (set by group) ****  upload 

Cookbook.ToDo   (attr) :

read    edit  ****  attr  (set by group) ****  upload 

20 pages displayed

Remove the 'count' and 'group' as required.

Notes

Release notes

If the recipe has multiple releases, then release notes can be placed here. Note that it's often easier for people to work with "release dates" instead of "version numbers".

See also

Contributors

Comments

See discussion at PagelistAuthListShort-Talk?

User notes +1: If you use, used or reviewed this recipe, you can add your name. These statistics appear in the Cookbook listings and will help newcomers browsing through the wiki.