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

  • Home
  • SEARCH
  • 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 8528117
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T08:43:53+00:00 2026-06-11T08:43:53+00:00

I am writing a repository program in java, I have a User table that

  • 0

I am writing a repository program in java, I have a User table that contains the users of repository and a File Table that contains all the imported files in repository, in MYSQL database.How can I set access privileges of my files to users?In fact how can I determine which user have witch access privilege(read,write,read and write) to which file in repository?

Thanks

  • 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-11T08:43:54+00:00Added an answer on June 11, 2026 at 8:43 am

    If you’re writing a file repository then file access privileges should be a concept of your mocel. Wouldn’t you usually have a dedicated user for running the file repository program and all of the files would have privileges of that user.

    Then the program after authorising the user would read from it’s database table what kind of privileges do users have to the files they want to fetch.

    Since you’re storing files physically in the database as BLOB objects then you should create another table that will store user privilages to these files.

    create table privileges (
        userid bigint,
        fileid bigint,
        read bool,
        write bool,
        PRIMARY KEY (userid,fileid)
    )
    

    Then whenever you want to check whether a user has read permission to a file you do

    select userid, fileid from user u join privileges p on u.id=p.userid join files f on f.id=p.fileid and p.read=1
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

A remote CMIS repository contains many folders/files. I am writing a software that keeps
I'm writing a semi-automated deploy script that allows users to tag the repository at
I am writing a program that uses IoC(Windsor v3.0) at startup to load all
I'm currently writing a little zsh function that checks all of my git repositories
I'm writing a program (a Perl script - but technology is not critical) that
I'm writing an app that we may be switching out the repository later (currently
I'm building a program that relies on a old legacy system. I'm especially writing
I'm writing a utility in Python that will attach changed files in Subversion to
Is there any API for writing a C# program that could interface with Windows
So basically i have a domain object and a generic repository that can do

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.