Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8007045
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T17:42:21+00:00 2026-06-04T17:42:21+00:00

ellou’ I want or rather need to control restrictions for some actions and controllers

  • 0

ellou’

I want or rather need to control restrictions for some actions and controllers via database settings, which is best way to do such job?

What is my goal: I need to create solution, where there will be lot of user groups (stored in DB) and they will be fully dynamic (created and removed from the admin panel). Permissions should be inherited to subgroups, so if user has role EditorsChief he can also perform actions allowed to all Editor. I cannot just annotate action/controller with @Restrict({"EditorsChief", "Editor"}) because they doesn’t exist (are supposed to be created on the fly with admin panel).

My first thoughts are to use @Dynamic controller and grouping the restrictions with separate handlers which of course requiring to hardcode some of them. It’s not quite bad – with some attention it’s possible to set quite good schema, (ie. by naming handlers with convention: handlerControllerAction, handlerControllerOtherAction…

What are your thoughts ? Am I going in good direction ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T17:42:22+00:00Added an answer on June 4, 2026 at 5:42 pm

    The best way to do this IMO is to use the Dynamic annotation, and give each one a distinct name that describes the function of the method. Since you have a finite number of annotated methods in your code, you can then store these names in a database (possibly caching them, as suggested above, for performance).

    In the admin panel, you can then associate these names with groups, roles, or whatever, and perform the control based on that. This would be, off the top of my head, a one-to-many relationship in the DB.

    Let me know if I need to explain this more completely.

    Steve (author of Deadbolt)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to create a Ruby script which opens a SSH pseudo-tty-less connection, and
I need an HTML-safe function which will change a first letter of the content
hi i want to replace all e in a string with - which are
ellou' In all dialog boxes of PhpStorm (3.0) and IntelliJ (11.0) keyboard shortcuts are
For example, I need to see if a string contains a substring, so I
I've got a loop that wants to execute to exhaustion or until some user
i need to check if a string is in array as part of a
Lets say that I have 10,000 regexes and one string and I want to
Need a clarification while looking at calculating a running checksum. Assume I have data
Any algorithm which changes a word from a string to a blank? I'm having

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.