As the title says, i have a need to create a dynamic menu stored
as a tree in the database
and there are plans to put an interface on it.Now i need to decide how to implement the Access Control Layer
based on what is on the market suitable for this requirement.
I heavily use Spring IoC
, spring mvc
etc....with hibernate
for my project. I've used apache shiro
before and it's not bad.just that the community is still young so it takes time for a question regarding shiro to have contributions and there is not extensive documentation.
I was still planing on using shiro
anyway because i've an experience which i don't have with spring security
.Now the first question should have been Is is a good idea to tie ACL to menu system|navigation system .I would be please if anyone could share his experience regarding that.
So on top of my head i have this model in mind users
, roles
, rights
, users_rights
,roles_users
, roles_rights
users //contains creds and user detail
roles //contains roles
rights // contains rights (including menu entries matching rights, if i have to tie them)
roles_users //many-to-many roles-users with extra columns mapped as entity
roles_rights // many-to-many roles-rights with extra columns mapped as entity
users_rights //many-to-many users-rights mapped as entity with extra columns. special rights for user and overwrite the overall rights given by roles. can deny rights given by a role or add rights not inside any roles
so in the rights table i could have like:
id
name // in the form of admin:users:list
description
menu_name // unique name what shows on page
menu_url
the only question is that how do i handle submenu? self many-to-many rights-rights? at the end it all becomes so complex.So i would like have other perspective, insights ,suggestions. thanks