All Downloads are FREE. Search and download functionalities are using the official Maven repository.

functions.Operation.ext Maven / Gradle / Ivy

There is a newer version: 1.24.1
Show newest version
extension functions::TypeChecks;
extension functions::SecurityRole;
extension functions::SystemProperties;
extension functions::JEAFService;
extension functions::RESTResource;

cached boolean isOperation(uml::Element element):
    element.isInstanceOf("org.eclipse.uml2.uml.Operation");
    
cached uml::Operation asOperation(uml::Element element):
    (uml::Operation) element;
    
cached List[uml::Parameter] getInputParameters(uml::Operation operation):
   operation.ownedParameter.select(p| p.isInputParam());

cached boolean isInputParam(uml::Parameter parameter):
	parameter.direction.toString() != "return";
    
cached boolean hasSecurityRoles(uml::Operation operation):
    !operation.getSecurityRoles().isEmpty;

cached List[String] getSecurityRoles(uml::Operation operation):
    if operation.getAssignedSecurityRoles().isEmpty == false
    then operation.getAssignedSecurityRoles()
    else operation.getDefaultRole(); 
    	
    	
private cached List[String] getDefaultRole(uml::Operation operation):
	if (operation.owner.isJEAFService() || operation.owner.isRESTResource()) && getDefaultSecurityRoleName().length > 0
	then {getDefaultSecurityRoleName()}.toList()
	else {}.toList();
	

private cached List[String] getAssignedSecurityRoles(uml::Operation operation):
    operation.getAssociatedSecurityRoles().addAll(operation.owner.getAssociatedSecurityRoles()).toSet().name.sortBy(e|e);

cached List[String] getSecurityRolesForDocumentation(uml::Operation operation):
	if operation.getAssignedSecurityRoles().isEmpty == false
	then operation.getAssignedSecurityRolesForDocumentation()
	else operation.getDefaultRole();
    
private cached List[String] getAssignedSecurityRolesForDocumentation(uml::Operation operation):
    operation.getAssociatedSecurityRoles().addAll(operation.owner.getAssociatedSecurityRoles().select(e|e.excludeFromDocumentation == false)).toSet().name.sortBy(e|e);






© 2015 - 2024 Weber Informatics LLC | Privacy Policy