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 8757321
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T14:16:25+00:00 2026-06-13T14:16:25+00:00

In my project, I send scheduled mails to all registered users. Up to now,

  • 0

In my project, I send scheduled mails to all registered users. Up to now, there were no restrictions, so I just got all the Users from the database and sent the mails without any security checks. Now, I have to make sure, that only users with a certain role receive those mails.

The only thing I found so far are several ways to check the roles of the currently logged in user. But I need to check the roles of a whole list of users, that are currently not logged in.

I can’t figure out how to access these roles. I don’t even know if this can be done with spring security at all. So, does anyone know about this kind of problem?

Thanks for your help!

  • 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-13T14:16:26+00:00Added an answer on June 13, 2026 at 2:16 pm

    I think that you did not understand what the ‘role’ means for a user. Usually the role is implemented in the database part of the application. You may have the User table with attributes (id, name, sname, ...., role) (1st case) or you may have it as a separate table ex ‘Roles’ with attributes (id, name, desc) and then have a FK in your User table that will link to the Roles table (2nd case).

    So, when you want to send an email to all those with role = admin then you do it like this:

    sql = "select * from users where role = 'admin'"; //First case
    
    sql = "select * from users , roles where users.role_id = roles.id and roles.desc = 'admin' "; //second case
    

    As you have guessed the implementation of this, has nothing to do with spring or whatever security…

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

Sidebar

Related Questions

For my current project I have to send a signature from PHP to Java
I'm trying to send an object from my ASP .NET C# MVC3 project to
In my Project i am using YiiMail extension to send mail to the users.
I'm learning c++ and got the project to send a pascal's triangle to output
I have to send a mail from go daddy in a project, and that
I've got a project where by I send email using PHP's inbuilt mail() function,
I am trying to send the files from an Android project so that a
I am looking at a project where we send information from a peripheral device
I've got to interface my C++ project with a C# project and send an
In my project client send some text, some images to the server. Server need

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.