consts

package
v0.0.0-...-2e80e89 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Permissions has the types of permissions that can be assigned
	Permissions = permissionTypes{
		Create: "create:%s",
		Read:   "read:%s",
		Update: "update:%s",
		Delete: "delete:%s",
		List:   "list:%s",
		Assign: "assign:%s",
		Upload: "upload:%s",
	}
	// EntityNames the names of the tables in the server
	EntityNames = entitynames{
		Users:           "Users",
		Roles:           "Roles",
		Permissions:     "Permissions",
		RoleParents:     "RoleParents",
		RolePermissions: "RolePermissions",
		UserPermissions: "UserPermissions",
		UserProfiles:    "UserProfiles",
		UserRoles:       "UserRoles",
	}
	// Dialects are definition of databases
	Dialects = dialects{
		PostgresSQL: "postgres",
		MySQL:       "mysql",
	}

	// Roles that are part of the systme
	Roles = []role{
		{
			Name:        "admin",
			Description: "Administrator of the app",
		},
		{
			Name:        "user",
			Description: "Normal user of the app",
		},
	}
)

Functions

func FormatPermissionDesc

func FormatPermissionDesc(action string, entity string) string

FormatPermissionDesc returns a string with the description of the action:entity permission

func FormatPermissionTag

func FormatPermissionTag(action string, entity string) string

FormatPermissionTag returns a string formatted action:entity permission

func GetTableName

func GetTableName(tablename string) string

GetTableName gets the db normalized tablename

Types

This section is empty.

Jump to

Keyboard shortcuts

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