Exemplo n.º 1
0
        public BoolTO hasPermission(string uid, string permissionName)
        {
            BoolTO result = new BoolTO();

            if (!(MdwsUtils.isAuthorizedConnection(mySession) == "OK"))
            {
                result.fault = new FaultTO("Connections not ready for operation", "Need to login?");
            }
            else if (String.IsNullOrEmpty(uid))
            {
                result.fault = new FaultTO("Empty UID");
            }
            else if (String.IsNullOrEmpty(permissionName))
            {
                result.fault = new FaultTO("Empty permission name");
            }
            if (result.fault != null)
            {
                return(result);
            }

            try
            {
                AbstractPermission p = new gov.va.medora.mdo.dao.vista.MenuOption(permissionName);
                bool f = User.hasPermission(mySession.ConnectionSet.BaseConnection, uid, p);
                result = new BoolTO(f);
            }
            catch (Exception exc)
            {
                result.fault = new FaultTO(exc);
            }
            return(result);
        }
Exemplo n.º 2
0
        public BoolTO hasPermission(string uid, string permissionName)
        {
            BoolTO result = new BoolTO();

            if (!(MdwsUtils.isAuthorizedConnection(mySession) == "OK"))
            {
                result.fault = new FaultTO("Connections not ready for operation", "Need to login?");
            }
            else if (String.IsNullOrEmpty(uid))
            {
                result.fault = new FaultTO("Empty UID");
            }
            else if (String.IsNullOrEmpty(permissionName))
            {
                result.fault = new FaultTO("Empty permission name");
            }
            if (result.fault != null)
            {
                return result;
            }

            try
            {
                AbstractPermission p = new gov.va.medora.mdo.dao.vista.MenuOption(permissionName);
                bool f = User.hasPermission(mySession.ConnectionSet.BaseConnection, uid, p);
                result = new BoolTO(f);
            }
            catch (Exception exc)
            {
                result.fault = new FaultTO(exc);
            }
            return result;
        }