make UserInfoHandle.HasRoles public

This commit is contained in:
2025-08-07 16:08:47 -07:00
parent 9999d1ff87
commit 34bc623ce6

View File

@@ -58,7 +58,7 @@ func (usr UserInfoHandle) Validate() (bool, error) {
} }
return validate.Valid, nil return validate.Valid, nil
} }
func (usr UserInfoHandle) hasRoles(wantRoles model.Roles) (bool, error) { func (usr UserInfoHandle) HasRoles(wantRoles model.Roles) (bool, error) {
haveroles, err := usr.GetRoles() haveroles, err := usr.GetRoles()
if err != nil { if err != nil {
return false, err return false, err
@@ -94,25 +94,25 @@ func (usr UserInfoHandle) GetRoles() (model.Roles, error) {
// RoleThumbnail // RoleThumbnail
func (usr UserInfoHandle) HasRoleMapfixUpload() (bool, error) { func (usr UserInfoHandle) HasRoleMapfixUpload() (bool, error) {
return usr.hasRoles(model.RolesMapfixUpload) return usr.HasRoles(model.RolesMapfixUpload)
} }
func (usr UserInfoHandle) HasRoleMapfixReview() (bool, error) { func (usr UserInfoHandle) HasRoleMapfixReview() (bool, error) {
return usr.hasRoles(model.RolesMapfixReview) return usr.HasRoles(model.RolesMapfixReview)
} }
func (usr UserInfoHandle) HasRoleMapDownload() (bool, error) { func (usr UserInfoHandle) HasRoleMapDownload() (bool, error) {
return usr.hasRoles(model.RolesMapDownload) return usr.HasRoles(model.RolesMapDownload)
} }
func (usr UserInfoHandle) HasRoleSubmissionRelease() (bool, error) { func (usr UserInfoHandle) HasRoleSubmissionRelease() (bool, error) {
return usr.hasRoles(model.RolesSubmissionRelease) return usr.HasRoles(model.RolesSubmissionRelease)
} }
func (usr UserInfoHandle) HasRoleSubmissionUpload() (bool, error) { func (usr UserInfoHandle) HasRoleSubmissionUpload() (bool, error) {
return usr.hasRoles(model.RolesSubmissionUpload) return usr.HasRoles(model.RolesSubmissionUpload)
} }
func (usr UserInfoHandle) HasRoleSubmissionReview() (bool, error) { func (usr UserInfoHandle) HasRoleSubmissionReview() (bool, error) {
return usr.hasRoles(model.RolesSubmissionReview) return usr.HasRoles(model.RolesSubmissionReview)
} }
func (usr UserInfoHandle) HasRoleScriptWrite() (bool, error) { func (usr UserInfoHandle) HasRoleScriptWrite() (bool, error) {
return usr.hasRoles(model.RolesScriptWrite) return usr.HasRoles(model.RolesScriptWrite)
} }
/// Not implemented /// Not implemented
func (usr UserInfoHandle) HasRoleMaptest() (bool, error) { func (usr UserInfoHandle) HasRoleMaptest() (bool, error) {