My call to


throws the exception:

PermissionDeniedException: Session 1 (cuongtruc.tran) is not allowed to call method public java.util.List The session does not fulfill the permission rule SESSION (MATCHES THIS AND OWNS UserReadOwnRoles PERMISSION) OR OWNS UserReadRoles PERMISSION OR OWNS UserReadRoles@SYSTEM PERMISSION

I even tried with grant admin permisson to that user but still throws the same exception.

asked 26.02.2014 at 05:16

Tran%20Cuong%20Truc's gravatar image

Tran Cuong Truc
accept rate: 100%

edited 05.03.2014 at 08:49

Flavio%20Sadeghi's gravatar image

Flavio Sadeghi ♦♦


You can execute your code with systemUserPermissions using a callable function. In this Example I get a List of Roles of a User.

List<IRole> roles = Ivy.session().getSecurityContext().executeAsSystemUser(new Callable<List<IRole>>(){
            public List<IRole> call() throws Exception {
                List<IRole> roles = iuser.getRoles();
                return roles;


answered 26.02.2014 at 15:42

Raphael%20B%C3%BCrgin's gravatar image

Raphael Bürgin
accept rate: 55%

The method getRoles() only returns the roles that are directly assigned to the user. Whereas the method getAllRoles() returns also the roles that the user inherits because of the hierarchy of the roles.

(04.03.2014 at 17:21) Reto Weiss ♦♦ Reto%20Weiss's gravatar image

Login with "Developer" user


Grant Developer's permission for your Test User role


answered 26.02.2014 at 09:54

Tho%20Tran's gravatar image

Tho Tran
accept rate: 0%

This way is overtake the root permisson, it works thought but I'm worry about security.

But anyway, it will be an alternative way if the method below doesn't work. :)

(27.02.2014 at 03:21) Tran Cuong Truc Tran%20Cuong%20Truc's gravatar image
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: 26.02.2014 at 05:16

Seen: 2,892 times

Last updated: 05.03.2014 at 08:49