[Anthill-pro] Enhancement: Template permissions / Getting all
Agentusing remote script
Peter Steele
psteele at maxiscale.com
Tue Jun 17 11:46:36 CDT 2008
Some kind of "apply-to-all" concept or default security template would
definitely be great. We uniformly set User to have read-only access,
Build Master to have read/write, and Admin to have read/write/security.
However, we have to set this every time some new is introduced. Having a
default security setting would definitely be a nice feature addition.
-----Original Message-----
From: anthill-pro-bounces at lists.urbancode.com
[mailto:anthill-pro-bounces at lists.urbancode.com] On Behalf Of emerson
cargnin
Sent: Tuesday, June 17, 2008 2:50 AM
To: AnthillPro user and support list.; support at urbancode.com
Subject: [Anthill-pro] Enhancement: Template permissions / Getting all
Agentusing remote script
It would be great if there was a way to set up a common template for
permissions. For example, every new element would have a given set of
permissions that you can especify, you would have a different one for
each type, like for Agents, Projects, Workflows, etc. It's a real pain
to have to do it individually to each element, especialy using the
current GUI interface.
Meanwhile we don't get this fantastic feature.....
How do I get all agents in a system using remote scripting? Then I
will use the following to set up the permissions I need, let me know
if it is the right way:
//setting agent permissions
String roleName = "User"; // change to the name of the role you
want to grant permission to
Role role = RoleFactory.getInstance().restoreForName(roleName);
Agent[] agents=new Agent[10];
for (int i = 0; i < agents.length; i++) {
Resource resource
=ResourceFactory.getInstance().restoreForPersistent(agents[i]);
Permission perm = new Permission(true, resource, "read",role);
perm.store();
perm = new Permission(true, resource, "write",role);
perm.store();
}
Thank you
emerson
_______________________________________________
Anthill-pro mailing list
Anthill-pro at lists.urbancode.com
http://lists.urbancode.com/mailman/listinfo/anthill-pro
More information about the Anthill-pro
mailing list