malte
malte

Reputation: 1181

Can you use Shiro for Grails without Roles and Permissions?

I wonder if you can use Shiro-Plugin for Grails without having permissions and roles enabled?

In our current Project, we have an external database with just username and password and I am not able to create the permissions and roles table. Is there a way to implement one Shiro user with automatic permission to all Domains without role-management?

Upvotes: 0

Views: 276

Answers (1)

Aram Arabyan
Aram Arabyan

Reputation: 2359

From Shioro plugin documentation

Create a class in src/groovy or src/java that implements the grails.plugin.springsecurity.shiro.ShiroPermissionResolver interface, and define the Set<String> resolvePermissions(String username) method any way you like. Register your bean as the shiroPermissionResolver bean in resources.groovy, for example

import com.mycompany.myapp.MyShiroPermissionResolver
beans = {
   shiroPermissionResolver(MyShiroPermissionResolver)
}

Upvotes: 2

Related Questions