feat(archive): archive manage (#7817)
* feat(archive): archive management * fix(ftp-server): remove duplicate ReadAtSeeker realization * fix(archive): bad seeking of SeekableStream * fix(archive): split internal and driver extraction api * feat(archive): patch * fix(shutdown): clear decompress upload tasks * chore * feat(archive): support .iso format * chore
This commit is contained in:
@ -44,6 +44,8 @@ type User struct {
|
||||
// 9: webdav write
|
||||
// 10: ftp/sftp login and read
|
||||
// 11: ftp/sftp write
|
||||
// 12: can read archives
|
||||
// 13: can decompress archives
|
||||
Permission int32 `json:"permission"`
|
||||
OtpSecret string `json:"-"`
|
||||
SsoID string `json:"sso_id"` // unique by sso platform
|
||||
@ -127,6 +129,14 @@ func (u *User) CanFTPManage() bool {
|
||||
return (u.Permission>>11)&1 == 1
|
||||
}
|
||||
|
||||
func (u *User) CanReadArchives() bool {
|
||||
return (u.Permission>>12)&1 == 1
|
||||
}
|
||||
|
||||
func (u *User) CanDecompress() bool {
|
||||
return (u.Permission>>13)&1 == 1
|
||||
}
|
||||
|
||||
func (u *User) JoinPath(reqPath string) (string, error) {
|
||||
return utils.JoinBasePath(u.BasePath, reqPath)
|
||||
}
|
||||
|
Reference in New Issue
Block a user