«
Précédent
|
Suivant
»
Révision 675e977d
Ajouté par Remy Menard il y a presque 11 ans
- ID 675e977d6baa946d508d77b8721408cbe9155a8e
- Parent 8fd1d584
ETa/EpcisPHI/src/main/java/fr/unicaen/iota/epcisphi/xacml/ihm/factory/AccessPolicies.java | ||
---|---|---|
public AccessPolicies() {
|
||
}
|
||
|
||
public AccessPolicies(String sessionId, String owner) {
|
||
this.createQueryPolicies(sessionId, owner);
|
||
this.createCapturePolicies(sessionId, owner);
|
||
this.createAdminPolicies(sessionId, owner);
|
||
public AccessPolicies(String userId, String owner) {
|
||
this.createQueryPolicies(userId, owner);
|
||
this.createCapturePolicies(userId, owner);
|
||
this.createAdminPolicies(userId, owner);
|
||
}
|
||
|
||
public AccessPolicies(String sessionId, String owner, Module module) {
|
||
public AccessPolicies(String userId, String owner, Module module) {
|
||
switch (module) {
|
||
case adminModule:
|
||
this.createAdminPolicies(sessionId, owner);
|
||
this.createAdminPolicies(userId, owner);
|
||
break;
|
||
case queryModule:
|
||
this.createQueryPolicies(sessionId, owner);
|
||
this.createQueryPolicies(userId, owner);
|
||
break;
|
||
case captureModule:
|
||
this.createCapturePolicies(sessionId, owner);
|
||
this.createCapturePolicies(userId, owner);
|
||
break;
|
||
}
|
||
}
|
||
|
||
private synchronized void createQueryPolicies(String sessionId, String owner) {
|
||
OwnerPolicies ownerPolicies = MapSessions.getAPMSession(sessionId, owner).APMSession.getQueryPolicy(owner);
|
||
private synchronized void createQueryPolicies(String userId, String owner) {
|
||
OwnerPolicies ownerPolicies = MapSessions.getAPMSession(userId, owner).APMSession.getQueryPolicy(owner);
|
||
Node policies = new Node("", NodeType.policiesNode, null, Module.queryModule, null);
|
||
if (ownerPolicies != null) {
|
||
for (Object ogp : ownerPolicies.getPolicies()) {
|
||
... | ... | |
}
|
||
}
|
||
} else {
|
||
InterfaceHelper ih = MapSessions.getAPMSession(sessionId, owner);
|
||
InterfaceHelper ih = MapSessions.getAPMSession(userId, owner);
|
||
ownerPolicies = new OwnerPolicies(owner, fr.unicaen.iota.xacml.policy.Module.queryModule);
|
||
ih.APMSession.addQueryPolicy(ownerPolicies);
|
||
ih.APMSession.saveQueryPolicies(owner);
|
||
... | ... | |
getPoliciesQuery().add(policies);
|
||
}
|
||
|
||
private synchronized void createCapturePolicies(String sessionId, String owner) {
|
||
OwnerPolicies ownerPolicies = MapSessions.getAPMSession(sessionId, owner).APMSession.getCapturePolicy(owner);
|
||
private synchronized void createCapturePolicies(String userId, String owner) {
|
||
OwnerPolicies ownerPolicies = MapSessions.getAPMSession(userId, owner).APMSession.getCapturePolicy(owner);
|
||
Node policies = new Node("", NodeType.policiesNode, null, Module.captureModule, null);
|
||
|
||
if (ownerPolicies != null) {
|
||
... | ... | |
}
|
||
}
|
||
} else {
|
||
InterfaceHelper ih = MapSessions.getAPMSession(sessionId, owner);
|
||
InterfaceHelper ih = MapSessions.getAPMSession(userId, owner);
|
||
ownerPolicies = new OwnerPolicies(owner, fr.unicaen.iota.xacml.policy.Module.captureModule);
|
||
ih.APMSession.addCapturePolicy(ownerPolicies);
|
||
// createCapturePolicies(sessionId, owner);
|
||
... | ... | |
getPoliciesCapture().add(policies);
|
||
}
|
||
|
||
private synchronized void createAdminPolicies(String sessionId, String owner) {
|
||
OwnerPolicies ownerPolicies = MapSessions.getAPMSession(sessionId, owner).APMSession.getAdminPolicy(owner);
|
||
private synchronized void createAdminPolicies(String userId, String owner) {
|
||
OwnerPolicies ownerPolicies = MapSessions.getAPMSession(userId, owner).APMSession.getAdminPolicy(owner);
|
||
Node policies = new Node("", NodeType.policiesNode, null, Module.adminModule, null);
|
||
|
||
if (ownerPolicies != null) {
|
||
... | ... | |
}
|
||
}
|
||
} else {
|
||
InterfaceHelper ih = MapSessions.getAPMSession(sessionId, owner);
|
||
InterfaceHelper ih = MapSessions.getAPMSession(userId, owner);
|
||
ownerPolicies = new OwnerPolicies(owner, fr.unicaen.iota.xacml.policy.Module.administrationModule);
|
||
ih.APMSession.addAdminPolicy(ownerPolicies);
|
||
ih.APMSession.saveAdminPolicies(owner);
|
Formats disponibles : Unified diff
Version 2.1
- a few bugs fixed!
- uses the new DS events
- improves the session management
- the account creation by the web interface adds access policies to
the interface ("admin" policies), this is always done even if a
corresponding account exists in the LDAP directory
- simplifies the service
- upgrades Apache Tomcat to 7.0.42