@@ -0,0 +1,1450 @@
+/******************************************************************%0A * File:        SecurityAccess.java%0A * Created by:  Dave Reynolds%0A * Created on:  2 May 2016%0A * %0A * (c) Copyright 2016, Epimorphics Limited%0A *%0A *****************************************************************/%0A%0Apackage com.epimorphics.appbase.security;%0A%0Aimport java.util.List;%0A%0Aimport org.apache.shiro.SecurityUtils;%0Aimport org.apache.shiro.authz.AuthorizationException;%0Aimport org.apache.shiro.subject.PrincipalCollection;%0Aimport org.apache.shiro.subject.SimplePrincipalCollection;%0Aimport org.apache.shiro.subject.Subject;%0A%0Aimport com.epimorphics.appbase.core.ComponentBase;%0Aimport com.epimorphics.appbase.security.AppRealm;%0Aimport com.epimorphics.appbase.security.UserInfo;%0A%0A/**%0A * Component to support access to the security features%0A */%0Apublic class SecurityAccess extends ComponentBase %7B%0A%0A    public Subject getSubject() %7B%0A        return SecurityUtils.getSubject();%0A    %7D%0A    %0A    public List%3CUserInfo%3E listUsers() %7B%0A        return AppRealm.getRealm().getUserStore().listUsers(%22%22);%0A    %7D%0A    %0A    public boolean checkPermission(UserInfo user, String permission) %7B%0A        AppRealm realm = AppRealm.getRealm();%0A        PrincipalCollection pc = new SimplePrincipalCollection(user, realm.getName());%0A        try %7B%0A            realm.checkPermission(pc, permission);%0A            return true;%0A        %7D catch (AuthorizationException e) %7B%0A            return false;%0A        %7D%0A    %7D%0A%7D%0A

Add appbase helper component for accessing security info