Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into issue_397
- Loading branch information
Showing
6 changed files
with
384 additions
and
279 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,134 +1,199 @@ | ||
<dtml-var manage_page_header> | ||
|
||
<dtml-with "_(management_view='Security')" | ||
><dtml-if manage_tabs | ||
><dtml-var manage_tabs | ||
></dtml-if | ||
></dtml-with> | ||
<dtml-with "_(management_view='Security')"> | ||
<dtml-if manage_tabs> | ||
<dtml-var manage_tabs> | ||
</dtml-if> | ||
</dtml-with> | ||
|
||
<main class="container-fluid"> | ||
|
||
<p class="form-help mb-4"> | ||
The listing below shows the current security settings for this item. | ||
Permissions are rows and roles are columns. Checkboxes are used to | ||
indicate where roles are assigned permissions. You can also assign | ||
<strong><a href="manage_listLocalRoles">local roles</a></strong> to | ||
users, which give users extra roles in the context of this object and | ||
its subobjects.<br /> | ||
When a role is assigned to a permission, users with the given role | ||
will be able to perform tasks associated with the permission on this | ||
item. When the <em>Acquire permission settings</em> checkbox is selected | ||
then the containing objects's permission settings are used. Note: the | ||
acquired permission settings may be augmented by selecting Roles for | ||
a permission in addition to selecting to acquire permissions. | ||
</p> | ||
|
||
<form action="manage_reportUserPermissions" method="get" class="mb-4"> | ||
<div class="form-group row form-inline"> | ||
<label for="username" class="col-sm-3 col-md-2">Username:</label> | ||
<div class="col-sm-9 col-md-10"> | ||
<input class="form-control mr-3" type="text" id="username" name="user" | ||
required="required" placeholder="Enter name of user ..." /> | ||
<input type="submit" | ||
class="btn btn-primary mr-sm-2" | ||
title="Show me the user permissions and roles in the context of the current object" | ||
value="Show permissions" /> | ||
<input type="button" | ||
class="btn btn-primary mr-3" | ||
title="Add a New Local Roles for the entered or any other User Name" | ||
onclick="window.location.href='manage_listLocalRoles?username=' + $('#username').val()" | ||
value="Assign Local Roles" /> | ||
</div> | ||
</div> | ||
</form> | ||
|
||
<dtml-with expr="_.namespace(valid_roles=valid_roles())"> | ||
<form action="manage_changePermissions" method="post"> | ||
<table class="table table-hover table-bordered"> | ||
<thead> | ||
<tr> | ||
<th scope="col" colspan="2" class="zmi-table-head-permisions">Permissions</th> | ||
<th scope="col" colspan="<dtml-var expr="_.len(valid_roles)">" class="zmi-table-head-roles">Roles</th> | ||
<th class="blank"> </th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<dtml-in permission_settings mapping | ||
><dtml-let permmission_title="name" | ||
><dtml-if "not (_['sequence-index']%10)"> | ||
<tr class="zmi-table-head"> | ||
<th class="zmi-akcquire-title" title="Acquire?"> | ||
<dtml-unless isTopLevelPrincipiaApplicationObject> | ||
<a href="manage_acquiredForm">Acquire?</a> | ||
</dtml-unless> | ||
</th> | ||
<th class="zmi-permission" title="Permission">Permission</th> | ||
<dtml-in valid_roles> | ||
<th class="zmi-rolename" title="&dtml-sequence-item;"><div><span>&dtml-sequence-item;</span></div></th> | ||
</dtml-in> | ||
<th class="blank"><div><span> </span></div></th> | ||
</tr> | ||
</dtml-if> | ||
<tr> | ||
<td class="zmi-akcquire-check"> | ||
<dtml-if isTopLevelPrincipiaApplicationObject> <dtml-else | ||
><input type="checkbox" name="acquire_&dtml-hashed_name;" &dtml-acquire; /> | ||
</dtml-if> | ||
</td> | ||
<td class="zmi-akcquire-title nowrap"> | ||
<a href="manage_permissionForm?permission_to_manage=&dtml.url_quote-name;">&dtml-name;</a> | ||
</td> | ||
<dtml-in roles mapping | ||
><td class="zmi-rolename-check" title="Role: <dtml-var "valid_roles[_['sequence-index']]">" | ||
onclick="$(this).children('input').trigger('click')"> | ||
<label class="sr-only sr-only-focusable" | ||
for="&dtml-name;">Role: <dtml-var "valid_roles[_['sequence-index']]">, Permission: <dtml-var "_['permmission_title']"></label> | ||
<input type="checkbox" &dtml-checked; id="&dtml-name;" name="&dtml-name;" onclick="event.stopPropagation()" /> | ||
</td> | ||
</dtml-in> | ||
<td class="blank"> </td> | ||
</tr> | ||
</dtml-let | ||
></dtml-in permission_settings | ||
></tbody> | ||
</table> | ||
<div class="zmi-controls"> | ||
<input type="submit" class="btn btn-primary" name="submit" value="Save Changes" /> | ||
</div> | ||
</form> | ||
</dtml-with> | ||
|
||
|
||
<dtml-if "_['id'] != 'acl_users'"> | ||
|
||
<p class="form-help mt-4"> | ||
You can define new roles by entering a role name and clicking the | ||
"Add Role" button. | ||
</p> | ||
|
||
<form action="manage_defined_roles" method="post" class="form"> | ||
<div class="form-group"> | ||
<label for="username" class="nowrap">User defined roles</label> | ||
<div class="form-inline"> | ||
<input type="text" class="form-control col-sm-6 col-md-3 mr-2 mb-2" id="role" name="role" placeholder="Define a new user role ..." /> | ||
<input type="submit" class="btn btn-primary mb-2" name="submit" value="Add Role" /> | ||
</div> | ||
</div> | ||
<dtml-if userdefined_roles> | ||
<div class="form-group"> | ||
<div class="form-inline"> | ||
<select name="roles:list" class="form-control col-sm-6 col-md-3 mr-2 mb-2"> | ||
<dtml-in userdefined_roles> | ||
<option value="&dtml-sequence-item;">&dtml-sequence-item;</option> | ||
</dtml-in> | ||
</select> | ||
<input type="submit" class="btn btn-primary mb-2" name="submit" value="Delete Role" /> | ||
</div> | ||
</div> | ||
</dtml-if> | ||
</form> | ||
</dtml-if> | ||
<dtml-let roles="valid_roles()" | ||
short_form="len(roles) > 20"> | ||
|
||
<p class="form-help mb-4"> | ||
The listing below shows the current security settings for this item. | ||
You can also assign | ||
<strong><a href="manage_listLocalRoles">local roles</a></strong> to | ||
users, which give users extra roles in the context of this object and | ||
its subobjects.<br /> | ||
</p> | ||
|
||
<form action="manage_reportUserPermissions" method="get" class="mb-4"> | ||
<div class="form-group row form-inline"> | ||
<label for="username" class="col-sm-3 col-md-2">Username:</label> | ||
<div class="col-sm-9 col-md-10"> | ||
<input class="form-control mr-3" type="text" id="username" name="user" | ||
required="required" placeholder="Enter name of user ..." /> | ||
<input type="submit" | ||
class="btn btn-primary mr-sm-2" | ||
title="Show user permissions and roles in the context of the current object" | ||
value="Show permissions" /> | ||
<input type="button" | ||
class="btn btn-primary mr-3" | ||
title="Add a New Local Role for the entered or any other User Name" | ||
onclick="window.location.href='manage_listLocalRoles?username=' + $('#username').val()" | ||
value="Assign Local Roles" /> | ||
</div> | ||
</div> | ||
</form> | ||
|
||
<hr/> | ||
|
||
<dtml-if short_form> | ||
|
||
<h3>Permissions</h3> | ||
|
||
<p class="form-help mb-4"> | ||
Click on one of the permission names to see the roles they are assigned | ||
to. | ||
</p> | ||
|
||
<table> | ||
<dtml-in "ac_inherited_permissions(1)"> | ||
<tr> | ||
<td class="zmi-akcquire-title nowrap"> | ||
<dtml-let pname="_['sequence-key']"> | ||
<a href="manage_permissionForm?permission_to_manage=&dtml.url_quote-pname;">&dtml-pname;</a> | ||
</dtml-let> | ||
</td> | ||
</tr> | ||
</dtml-in> | ||
</table> | ||
|
||
<dtml-else> | ||
|
||
<h3>Role to permission assignments</h3> | ||
|
||
<p class="form-help mb-4"> | ||
This table shows which permissions are assigned to each role. Permissions | ||
are rows and roles are columns.<br/> | ||
When a role is assigned to a permission, users with the given role | ||
will be able to perform tasks associated with the permission on this | ||
item. | ||
<dtml-unless isTopLevelPrincipiaApplicationObject> | ||
<br/> | ||
When the <em>Acquire?</em> checkbox is selected | ||
then the containing objects's permission settings are used. Note: the | ||
acquired permission settings may be augmented by selecting Roles for | ||
a permission in addition to selecting to acquire permissions. | ||
</dtml-unless> | ||
</p> | ||
|
||
<dtml-with "_.namespace(valid_roles=roles)"> | ||
<form action="manage_changePermissions" method="post"> | ||
<table class="table table-hover table-bordered"> | ||
<thead> | ||
<tr> | ||
<th scope="col" colspan="2" class="zmi-table-head-permisions"> | ||
Permissions | ||
</th> | ||
<th scope="col" colspan="<dtml-var expr="_.len(valid_roles)">" | ||
class="zmi-table-head-roles">Roles</th> | ||
<th class="blank"> </th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
|
||
<dtml-in permission_settings mapping> | ||
<dtml-let permmission_title="name"> | ||
<dtml-if "not (_['sequence-index']%10)"> | ||
<tr class="zmi-table-head"> | ||
<th class="zmi-akcquire-title" title="Acquire?"> | ||
<dtml-unless isTopLevelPrincipiaApplicationObject> | ||
<a href="manage_acquiredForm">Acquire?</a> | ||
</dtml-unless> | ||
</th> | ||
<th class="zmi-permission" title="Permission">Permission</th> | ||
<dtml-in valid_roles> | ||
<th class="zmi-rolename" title="&dtml-sequence-item;"> | ||
<div><span>&dtml-sequence-item;</span></div> | ||
</th> | ||
</dtml-in> | ||
<th class="blank"><div><span> </span></div></th> | ||
</tr> | ||
</dtml-if> | ||
<tr> | ||
<td class="zmi-akcquire-check"> | ||
<dtml-if isTopLevelPrincipiaApplicationObject> | ||
| ||
<dtml-else> | ||
<input type="checkbox" name="acquire_&dtml-hashed_name;" | ||
&dtml-acquire; /> | ||
</dtml-if> | ||
</td> | ||
<td class="zmi-akcquire-title nowrap"> | ||
<a href="manage_permissionForm?permission_to_manage=&dtml.url_quote-name;">&dtml-name;</a> | ||
</td> | ||
<dtml-in roles mapping> | ||
<td class="zmi-rolename-check" | ||
title="Role: <dtml-var "valid_roles[_['sequence-index']]">" | ||
onclick="$(this).children('input').trigger('click')"> | ||
<label class="sr-only sr-only-focusable" | ||
for="&dtml-name;"> | ||
Role: <dtml-var "valid_roles[_['sequence-index']]">, | ||
Permission: <dtml-var "_['permmission_title']"> | ||
</label> | ||
<input type="checkbox" &dtml-checked; id="&dtml-name;" | ||
name="&dtml-name;" onclick="event.stopPropagation()" /> | ||
</td> | ||
</dtml-in> | ||
<td class="blank"> </td> | ||
</tr> | ||
</dtml-let> | ||
</dtml-in permission_settings> | ||
|
||
</tbody> | ||
</table> | ||
|
||
<div class="zmi-controls"> | ||
<input type="submit" class="btn btn-primary" name="submit" | ||
value="Save Changes" /> | ||
</div> | ||
</form> | ||
</dtml-with> | ||
|
||
</dtml-if short_form> | ||
|
||
</dtml-let> | ||
|
||
<dtml-if "_['id'] != 'acl_users'"> | ||
|
||
<hr/> | ||
|
||
<h3>Add or delete user-defined roles</h3> | ||
|
||
<p class="form-help mt-4"> | ||
You can define new roles by entering a role name and clicking the | ||
"Add Role" button. | ||
</p> | ||
|
||
<form action="manage_defined_roles" method="post" class="form"> | ||
<div class="form-group"> | ||
<label for="username" class="nowrap">User defined roles</label> | ||
<div class="form-inline"> | ||
<input type="text" class="form-control col-sm-6 col-md-3 mr-2 mb-2" | ||
id="role" name="role" placeholder="Define a new user role ..." /> | ||
<input type="submit" class="btn btn-primary mb-2" name="submit" | ||
value="Add Role" /> | ||
</div> | ||
</div> | ||
<dtml-if userdefined_roles> | ||
<div class="form-group"> | ||
<div class="form-inline"> | ||
<select name="roles:list" | ||
class="form-control col-sm-6 col-md-3 mr-2 mb-2"> | ||
<dtml-in userdefined_roles> | ||
<option value="&dtml-sequence-item;">&dtml-sequence-item;</option> | ||
</dtml-in> | ||
</select> | ||
<input type="submit" class="btn btn-primary mb-2" name="submit" | ||
value="Delete Role" /> | ||
</div> | ||
</div> | ||
</dtml-if> | ||
</form> | ||
</dtml-if> | ||
</main> | ||
|
||
<dtml-var manage_page_footer> | ||
|
Oops, something went wrong.