Skip to content

Commit 2ca51a1

Browse files
committed
update docs
1 parent 6cf442b commit 2ca51a1

File tree

10 files changed

+39
-23
lines changed

10 files changed

+39
-23
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,5 +153,4 @@ an init hook script.
153153

154154
* [Changelog](https://github.com/jenkinsci/role-strategy-plugin/releases)
155155
* [Macro extensions](./docs/MACROS.md)
156-
* [Greasemonkey Addons for Web UI](./docs/USERSCRIPTS.md)
157156
* [Developer documentation](./docs/DEVELOPER.md)

docs/DEVELOPER.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,10 @@ Verify that following things work on `Assign Roles`:
2929
2. Deleting a role by pressing on the red x deletes the role
3030
3. Hovering over the checkboxes properly highlights the row and column and shows a tooltip
3131
4. Entering html as user is printed as plain text in the field and in the tooltips.
32+
5. Check that pagination works especially in combination with the filters.
3233

33-
34+
Creating some hundred item roles and assignments
35+
Use the file [roles.groovy](roles.groovy) to generate 400 item roles and assign each role a user and a group
3436

3537
### Code details
3638

docs/USERSCRIPTS.md

Lines changed: 0 additions & 20 deletions
This file was deleted.

docs/images/assignRoles.png

31.9 KB
Loading

docs/images/configureSecurity.png

-19.2 KB
Loading
-23.6 KB
Binary file not shown.

docs/images/manageRoles.png

-62.1 KB
Loading
-9.06 KB
Binary file not shown.

docs/roles.groovy

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import com.michelin.cio.hudson.plugins.rolestrategy.AuthorizationType
2+
import com.michelin.cio.hudson.plugins.rolestrategy.PermissionEntry
3+
import com.michelin.cio.hudson.plugins.rolestrategy.RoleBasedAuthorizationStrategy
4+
import com.michelin.cio.hudson.plugins.rolestrategy.Role
5+
import com.synopsys.arc.jenkins.plugins.rolestrategy.RoleType
6+
import hudson.security.Permission
7+
8+
9+
Jenkins jenkins = Jenkins.get()
10+
def rbas = jenkins.getAuthorizationStrategy()
11+
12+
/* create admin role */
13+
Set<Permission> permissions = new HashSet<>();
14+
permissions.add(Item.READ)
15+
permissions.add(Item.BUILD)
16+
17+
18+
itemRoleMap = rbas.getRoleMap(RoleType.Project)
19+
20+
for (i = 101; i <=500; i++) {
21+
role = "role-"+i;
22+
user = "user-"+i
23+
group = "group-"+i
24+
//r = new Role(role, role, permissions)
25+
//itemRoleMap.addRole(r)
26+
//itemRoleMap.assignRole(r, new PermissionEntry(AuthorizationType.USER, user))
27+
//itemRoleMap.assignRole(r, new PermissionEntry(AuthorizationType.GROUP, group))
28+
r = itemRoleMap.getRole(role)
29+
itemRoleMap.removeRole(r)
30+
}
31+
32+
jenkins.save()

src/main/webapp/js/tableAssign.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,10 @@ function addButtonAction(button, template, table, tableHighlighter) {
210210
addPermissionEntry(json, name, type);
211211
const container = table.closest(".rsp-roles-container");
212212
const roleInputFilter = container.querySelector(".role-input-filter");
213-
const roleFilter = roleInputFilter.value.toUpperCase();
213+
let roleFilter = "";
214+
if (roleInputFilter !== null) {
215+
roleFilter = roleInputFilter.value.toUpperCase();
216+
}
214217
filterRoles(roleFilter, table);
215218
Behaviour.applySubtree(table, true);
216219
});

0 commit comments

Comments
 (0)