package it.micegroup.voila2.cartridge.library.javaservice;

import org.eclipse.uml2.uml.Class;

public class SecurityUtils {

	/**
	 * Check if an entity has the securityUser's Role. This could be used to add
	 * specific features for the class.
	 * 
	 * @author Vittorio Niespolo <vittorio.niespolo@micegroup.it>
	 * @param classe
	 * @return
	 */
	public static boolean isInSecurityUserRole(Class classe) {
		return EntityUtils.isInRole(classe, "securityUser");
	}

	/**
	 * Check if an entity has the privilegePerRole's Role. This could be used to add
	 * specific features for the class.
	 * 
	 * @author Vittorio Niespolo <vittorio.niespolo@micegroup.it>
	 * @param classe
	 * @return
	 */
	public static boolean isInPrivilegePerRoleRole(Class classe) {
		return EntityUtils.isInRole(classe, "privilegePerRole");
	}

	/**
	 * Check if an entity has the role's Role. This could be used to add specific
	 * features for the class.
	 * 
	 * @author Vittorio Niespolo <vittorio.niespolo@micegroup.it>
	 * @param classe
	 * @return
	 */
	public static boolean isInRoleRole(Class classe) {
		return EntityUtils.isInRole(classe, "role");
	}

	/**
	 * Check if an entity has the privilege's Role. This could be used to add
	 * specific features for the class.
	 * 
	 * @author Vittorio Niespolo <vittorio.niespolo@micegroup.it>
	 * @param classe
	 * @return
	 */
	public static boolean isInPrivilegeRole(Class classe) {
		return EntityUtils.isInRole(classe, "privilege");
	}

	/**
	 * Check if an entity has the rolePerSecurityUser's Role. This could be used to
	 * add specific features for the class.
	 * 
	 * @author Vittorio Niespolo <vittorio.niespolo@micegroup.it>
	 * @param classe
	 * @return
	 */
	public static boolean isInRolePerSecurityUserRole(Class classe) {
		return EntityUtils.isInRole(classe, "rolePerSecurityUser");
	}
}
