Package nexj.core.runtime

Examples of nexj.core.runtime.SecurityViolationException


               if (!Boolean.TRUE.equals(accessor.getValue(nOrdinal)) &&
                  (!(accessor instanceof Instance) ||
                     !Boolean.TRUE.equals(((Instance)accessor).getOldValue(nOrdinal))))
               {
                  throw new SecurityViolationException("err.runtime.access",
                     new Object[]{accessor.getMetaclass().getName()});
               }
            }

            machine.returnValue(null, nArgCount);
View Full Code Here


         if (context.isSecure())
         {
            if (!attribute.isUpdateable(context.getPrivilegeSet()))
            {
               throw new SecurityViolationException(
                  (attribute.isReadOnly()) ?
                     "err.runtime.attributeReadOnlyAccess" :
                     "err.runtime.attributeUpdateAccess",
                  new Object[]{attribute.getName(), getName()});
            }

            Attribute accessAttribute = attribute.getAccessAttribute();

            if (accessAttribute != null)
            {
               Object accessValue = getValue(accessAttribute.getOrdinal());

               if (accessValue instanceof Boolean && !((Boolean)accessValue).booleanValue())
               {
                  throw new SecurityViolationException("err.runtime.attributeUpdateAccess",
                     new Object[]{attribute.getName(), getName()});
               }
            }
         }
         else
         {
            if (attribute.isReadOnly())
            {
               throw new SecurityViolationException("err.runtime.attributeReadOnlyAccess",
                  new Object[]{attribute.getName(), getName()});
            }
         }

         attribute.invalidateDependency(this, Invalid.VALUE);
View Full Code Here

    */
   public final void checkReadAccess(PrivilegeSet privilegeSet) throws SecurityViolationException
   {
      if (m_nVisibility != PUBLIC)
      {
         throw new SecurityViolationException("err.rpc.classVisibility", new Object[]{getName()});
      }

      if (m_readPrivilege != null && !privilegeSet.contains(m_readPrivilege))
      {
         throw new SecurityViolationException("err.rpc.classReadPrivilege",
            new Object[]{getName(), m_readPrivilege.getName()});
      }
   }
View Full Code Here

               if (clazz != null)
               {
                  if (m_nVisibility != PUBLIC)
                  {
                     throw new SecurityViolationException("err.rpc.classVisibility", new Object[]{clazz.getName()});
                  }

                  pair = (Pair)expr;

                  if (pair.getHead() instanceof Pair)
                  {
                     int nArgCount = 0;
                     Object next;

                     for (next = pair.getTail(); next instanceof Pair; next = ((Pair)next).getTail())
                     {
                        ++nArgCount;
                     }

                     if (next == null)
                     {
                        pair = (Pair)pair.getHead();

                        if (pair.getHead() == Symbol.QUOTE && pair.getTail() instanceof Pair)
                        {
                           pair = pair.getNext();

                           if (pair.getHead() instanceof Symbol && pair.getTail() == null)
                           {
                              Member member = clazz.getSelector(pair.getHead().toString()).getMember(nArgCount);

                              if (!member.isStatic())
                              {
                                 throw new ScriptingException(
                                    (member.isAttribute()) ?
                                       "err.scripting.staticAttribute" :
                                       "err.scripting.staticEvent",
                                    new Object[]{member.getName(), clazz.getName()});
                              }

                              if (member.isAttribute())
                              {
                                 if (nArgCount == 0)
                                 {
                                    ((Attribute)member).checkReadAccess(privilegeSet);
                                 }
                                 else
                                 {
                                    ((Attribute)member).checkUpdateAccess(privilegeSet);
                                 }
                              }
                              else
                              {
                                 ((Event)member).checkAccess(privilegeSet);
                              }

                              expr = ((Pair)expr).getTail();
                              head = null;
                           }
                        }
                     }
                  }
               }
            }

            if (head != null && !m_metadata.isPublicSymbol((Symbol)head))
            {
               throw new SecurityViolationException("err.rpc.functionVisibility",
                  new Object[]{head});
            }
         }
         else if (head instanceof Pair)
         {
            throw new SecurityViolationException("err.rpc.expressionVisibility",
               new Object[]{head});
         }

         for (; expr instanceof Pair; expr = pair.getTail())
         {
View Full Code Here

    */
   public void checkAccess(PrivilegeSet privilegeSet) throws SecurityViolationException
   {
      if (m_nVisibility != Metaclass.PUBLIC)
      {
         throw new SecurityViolationException("err.rpc.eventVisibility",
            new Object[]{getName(), m_metaclass.getName()});
      }

      if (m_privilege != null && !privilegeSet.contains(m_privilege))
      {
         throw new SecurityViolationException("err.rpc.eventPrivilege",
            new Object[]{getName(), m_metaclass.getName(), m_privilege.getName()});
      }
   }
View Full Code Here

TOP

Related Classes of nexj.core.runtime.SecurityViolationException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.