use of org.apache.directory.fortress.core.model.AdminRoleRelationship in project directory-fortress-core by apache.
the class DelAdminMgrRestImpl method addDescendant.
/**
* {@inheritDoc}
*/
@Override
public void addDescendant(AdminRole parentRole, AdminRole childRole) throws SecurityException {
String methodName = "addDescendantRole";
VUtil.assertNotNull(parentRole, GlobalErrIds.ARLE_PARENT_NULL, CLS_NM + "." + methodName);
VUtil.assertNotNull(childRole, GlobalErrIds.ARLE_CHILD_NULL, CLS_NM + "." + methodName);
FortRequest request = new FortRequest();
request.setContextId(this.contextId);
AdminRoleRelationship relationship = new AdminRoleRelationship();
relationship.setParent(parentRole);
relationship.setChild(childRole);
request.setEntity(relationship);
if (this.adminSess != null) {
request.setSession(adminSess);
}
String szRequest = RestUtils.marshal(request);
String szResponse = RestUtils.getInstance().post(szRequest, HttpIds.ARLE_DESC);
FortResponse response = RestUtils.unmarshall(szResponse);
if (response.getErrorCode() != 0) {
throw new SecurityException(response.getErrorCode(), response.getErrorMessage());
}
}
use of org.apache.directory.fortress.core.model.AdminRoleRelationship in project directory-fortress-core by apache.
the class DelAdminMgrRestImpl method addAscendant.
/**
* {@inheritDoc}
*/
@Override
public void addAscendant(AdminRole childRole, AdminRole parentRole) throws SecurityException {
String methodName = "addAscendantRole";
VUtil.assertNotNull(parentRole, GlobalErrIds.ARLE_PARENT_NULL, CLS_NM + "." + methodName);
VUtil.assertNotNull(childRole, GlobalErrIds.ARLE_CHILD_NULL, CLS_NM + "." + methodName);
FortRequest request = new FortRequest();
request.setContextId(this.contextId);
AdminRoleRelationship relationship = new AdminRoleRelationship();
relationship.setParent(parentRole);
relationship.setChild(childRole);
request.setEntity(relationship);
if (this.adminSess != null) {
request.setSession(adminSess);
}
String szRequest = RestUtils.marshal(request);
String szResponse = RestUtils.getInstance().post(szRequest, HttpIds.ARLE_ASC);
FortResponse response = RestUtils.unmarshall(szResponse);
if (response.getErrorCode() != 0) {
throw new SecurityException(response.getErrorCode(), response.getErrorMessage());
}
}
use of org.apache.directory.fortress.core.model.AdminRoleRelationship in project directory-fortress-core by apache.
the class DelAdminMgrRestImpl method deleteInheritance.
/**
* {@inheritDoc}
*/
@Override
public void deleteInheritance(AdminRole parentRole, AdminRole childRole) throws SecurityException {
String methodName = "deleteInheritanceRole";
VUtil.assertNotNull(parentRole, GlobalErrIds.ARLE_PARENT_NULL, CLS_NM + "." + methodName);
VUtil.assertNotNull(childRole, GlobalErrIds.ARLE_CHILD_NULL, CLS_NM + "." + methodName);
FortRequest request = new FortRequest();
request.setContextId(this.contextId);
AdminRoleRelationship relationship = new AdminRoleRelationship();
relationship.setParent(parentRole);
relationship.setChild(childRole);
request.setEntity(relationship);
if (this.adminSess != null) {
request.setSession(adminSess);
}
String szRequest = RestUtils.marshal(request);
String szResponse = RestUtils.getInstance().post(szRequest, HttpIds.ARLE_DELINHERIT);
FortResponse response = RestUtils.unmarshall(szResponse);
if (response.getErrorCode() != 0) {
throw new SecurityException(response.getErrorCode(), response.getErrorMessage());
}
}
use of org.apache.directory.fortress.core.model.AdminRoleRelationship in project directory-fortress-core by apache.
the class DelAdminMgrRestImpl method addInheritance.
/**
* {@inheritDoc}
*/
@Override
public void addInheritance(AdminRole parentRole, AdminRole childRole) throws SecurityException {
String methodName = "addInheritanceRole";
VUtil.assertNotNull(parentRole, GlobalErrIds.ARLE_PARENT_NULL, CLS_NM + "." + methodName);
VUtil.assertNotNull(childRole, GlobalErrIds.ARLE_CHILD_NULL, CLS_NM + "." + methodName);
FortRequest request = new FortRequest();
request.setContextId(this.contextId);
AdminRoleRelationship relationship = new AdminRoleRelationship();
relationship.setParent(parentRole);
relationship.setChild(childRole);
request.setEntity(relationship);
if (this.adminSess != null) {
request.setSession(adminSess);
}
String szRequest = RestUtils.marshal(request);
String szResponse = RestUtils.getInstance().post(szRequest, HttpIds.ARLE_ADDINHERIT);
FortResponse response = RestUtils.unmarshall(szResponse);
if (response.getErrorCode() != 0) {
throw new SecurityException(response.getErrorCode(), response.getErrorMessage());
}
}
Aggregations