1 Reply Latest reply on Jan 13, 2010 5:18 AM by kabirkhan

    Usage of pre-defined JBoss AOP security library.

    mksong

      Hello, I would like to ask a question about the usage of pre-defined JBoss AOP security library.

      To test it, I wrote a source code which includes a pre-defined annotation and a user-defined annotation: Permissions and Roles.

      However, I got run-time-error attached. And I also attached the project-zip-file.

       

      Currently, I do not use JBoss Application server. I run this application stand-alone after compiling and aopc.

       

       

      package bank;

      import org.jboss.aspects.security.Permissions;

      import org.jboss.aspects.security.SecurityDomain;;


      @SecurityDomain ("other")

      public class BankAccount

      {

         int accountNumber;

         int balance;

        

         public int getAccountNumber() {

            return accountNumber;

         }

        

         public int getBalance() {

            return balance;

         }


         @Permissions ({"AuthorizedUser"})      // org.jboss.aspects.security.Permissions

         public void setAccountNumber(int accountNumber) {

         System.out.println("*** [success] : setAccountNumber");

            this.accountNumber = accountNumber;

         }


         @Roles(roles= {"admin"})     // bank.Roles

         public void setBalance(int balance) {

         System.out.println("*** [success] : setBalance");

            this.balance = balance;

         }

      }