Geend / HshHelper

Hannover University of Applied Sciences and Arts - Master Project - Security competition to make a secure filesharing website.
GNU General Public License v3.0
0 stars 1 forks source link

Implementation des Dateienaustauschs #7

Closed eloquenza closed 5 years ago

eloquenza commented 6 years ago

Folgende Metadaten muessen zu einer Datei abgespeichert werden:

Gruppe hat entschieden, dass Filename sowie Comment abused werden kann, daher sind diese bei den Quotas ebenfalls zu beachten, daher gilt folgende Rechnung:

currentQuota = maxQuota - fileSize - fileNameSize - commentSize;

FileManagerbrauch folgende Methoden:

boolean createFile(Long userId, File file, String filename, String comment);
boolean overwriteFile(Long userId, File file, String filename, String comment);
File readFile(Long userId, String filename);
List<File> listFiles(Long userId);
List<File> listMyOwnFiles(Long userId);
boolean deleteFile(String filename, Long userId);

UserManager brauch folgende neue Methode:

boolean changeQuota(Long userId, Long newQuotaLimit);

DB Modells:

CREATE TABLE files (
    fileid LONG,
    ownerid LONG,
    filename VARCHAR,
    filedata BLOB,
    comment VARCHAR,
    CONSTRAINT files_pk PRIMARY KEY(fileid),
    CONSTRAINT files_ownerid_fk FOREIGN KEY(ownerid) REFERENCES users(userid),
    CONSTRAINT files_uniq_name UNIQUE(fileid, filename)
)

CREATE TABLE user_permissions {
     fileid LONG,
     userid LONG,
     canRead BOOL,
     canWrite BOOL,    
    CONSTRAINT files_pk PRIMARY KEY(fileid, userid ),
    CONSTRAINT files_ownerid_fk FOREIGN KEY(fileid) REFERENCES files(fileid),
    CONSTRAINT files_ownerid_fk FOREIGN KEY(userid ) REFERENCES users(userid )
}

CREATE TABLE group_permissions {
     fileid LONG,
     groupid LONG,
     canRead BOOL,
     canWrite BOOL
    CONSTRAINT files_pk PRIMARY KEY(fileid, groupid),
    CONSTRAINT files_ownerid_fk FOREIGN KEY(fileid) REFERENCES files(fileid),
    CONSTRAINT files_ownerid_fk FOREIGN KEY(groupid) REFERENCES groups(groupid)
}
eloquenza commented 6 years ago

User Entity enthaelt bereits quota_limit member.

Flips01 commented 5 years ago

wurde implementiert. muss review unterzogen werden.