auth

package
v1.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 8, 2022 License: GPL-3.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	RoleApproveMods = &Role{
		ID:          "1",
		Description: "Allows user to approve mods",
	}
	RoleApproveVersions = &Role{
		ID:          "2",
		Description: "Allows user to approve versions",
	}
	RoleDeleteAnyContent = &Role{
		ID:          "3",
		Description: "Allows user to delete content: mod/version/guide",
	}
	RoleEditAnyContent = &Role{
		ID:          "4",
		Description: "Allows user to edit content: mod/version/guide",
	}
	RoleEditUsers = &Role{
		ID:          "5",
		Description: "Allows user to edit other users",
	}
	RoleEditSMLVersions = &Role{
		ID:          "6",
		Description: "Allows user to sml versions",
	}
	RoleEditBootstrapVersions = &Role{
		ID:          "7",
		Description: "Allows user to bootstrap versions",
	}
	RoleEditAnnouncements = &Role{
		ID:          "8",
		Description: "Allows user to manage announcements",
	}
	RoleManageTags = &Role{
		ID:          "9",
		Description: "Allows user to manage tags",
	}
	RoleEditAnyModCompatibility = &Role{
		ID:          "10",
		Description: "Allows user to edit any mod's compatibility info",
	}
)
View Source
var (
	GroupAdmin = &Group{
		ID:   "1",
		Name: "Admin",
		Roles: []*Role{
			RoleApproveMods,
			RoleApproveVersions,
			RoleDeleteAnyContent,
			RoleEditAnyContent,
			RoleEditUsers,
			RoleEditSMLVersions,
			RoleEditBootstrapVersions,
			RoleEditAnnouncements,
			RoleManageTags,
			RoleEditAnyModCompatibility,
		},
	}
	GroupModerator = &Group{
		ID:   "2",
		Name: "Moderator",
		Roles: []*Role{
			RoleApproveMods,
			RoleApproveVersions,
			RoleEditAnnouncements,
			RoleManageTags,
			RoleEditAnyModCompatibility,
		},
	}
	GroupSMLDev = &Group{
		ID:   "3",
		Name: "SML Dev",
		Roles: []*Role{
			RoleEditSMLVersions,
		},
	}
	GroupBootstrapDev = &Group{
		ID:   "4",
		Name: "Bootstrap Dev",
		Roles: []*Role{
			RoleEditBootstrapVersions,
		},
	}
	GroupCompatibilityOfficer = &Group{
		ID:   "5",
		Name: "Compatibility Officer",
		Roles: []*Role{
			RoleEditAnyModCompatibility,
		},
	}
)

Functions

func InitializeAuth

func InitializeAuth()

Types

type Group

type Group struct {
	ID    string
	Name  string
	Roles []*Role
}

func GetGroupByID

func GetGroupByID(id string) *Group

func GetRoleGroups

func GetRoleGroups(role *Role) []*Group

type Role

type Role struct {
	ID          string
	Description string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL