Versions in this module Expand all Collapse all v1 v1.0.1 Jan 13, 2024 v1.0.0 Jan 2, 2024 Changes in this version + type Options struct + DB *gorm.DB + Migrate bool + type Permify struct + PermissionRepository repositories.IPermissionRepository + RoleRepository repositories.IRoleRepository + UserRepository repositories.IUserRepository + func New(opts Options) (p *Permify, err error) + func (s *Permify) AddPermissionsToRole(r interface{}, p interface{}) (err error) + func (s *Permify) AddPermissionsToUser(userID uint, p interface{}) (err error) + func (s *Permify) AddRolesToUser(userID uint, r interface{}) (err error) + func (s *Permify) CreatePermission(name string, description string) (err error) + func (s *Permify) CreateRole(name string, description string) (err error) + func (s *Permify) DeletePermission(p interface{}) (err error) + func (s *Permify) DeleteRole(r interface{}) (err error) + func (s *Permify) GetAllPermissions(option options.PermissionOption) (permissions collections.Permission, totalCount int64, err error) + func (s *Permify) GetAllPermissionsOfUser(userID uint) (permissions collections.Permission, err error) + func (s *Permify) GetAllRoles(option options.RoleOption) (roles collections.Role, totalCount int64, err error) + func (s *Permify) GetDirectPermissionsOfUser(userID uint, option options.PermissionOption) (permissions collections.Permission, totalCount int64, err error) + func (s *Permify) GetPermission(p interface{}) (permission models.Permission, err error) + func (s *Permify) GetPermissions(p interface{}) (permissions collections.Permission, err error) + func (s *Permify) GetPermissionsOfRoles(r interface{}, option options.PermissionOption) (permissions collections.Permission, totalCount int64, err error) + func (s *Permify) GetRole(r interface{}, withPermissions bool) (role models.Role, err error) + func (s *Permify) GetRoles(r interface{}, withPermissions bool) (roles collections.Role, err error) + func (s *Permify) GetRolesOfUser(userID uint, option options.RoleOption) (roles collections.Role, totalCount int64, err error) + func (s *Permify) RemovePermissionsFromRole(r interface{}, p interface{}) (err error) + func (s *Permify) RemovePermissionsFromUser(userID uint, p interface{}) (err error) + func (s *Permify) RemoveRolesFromUser(userID uint, r interface{}) (err error) + func (s *Permify) ReplacePermissionsToRole(r interface{}, p interface{}) (err error) + func (s *Permify) ReplacePermissionsToUser(userID uint, p interface{}) (err error) + func (s *Permify) ReplaceRolesToUser(userID uint, r interface{}) (err error) + func (s *Permify) RoleHasAllPermissions(r interface{}, p interface{}) (b bool, err error) + func (s *Permify) RoleHasAnyPermissions(r interface{}, p interface{}) (b bool, err error) + func (s *Permify) RoleHasPermission(r interface{}, p interface{}) (b bool, err error) + func (s *Permify) UserHasAllDirectPermissions(userID uint, p interface{}) (b bool, err error) + func (s *Permify) UserHasAllPermissions(userID uint, p interface{}) (b bool, err error) + func (s *Permify) UserHasAllRoles(userID uint, r interface{}) (b bool, err error) + func (s *Permify) UserHasAnyDirectPermissions(userID uint, p interface{}) (b bool, err error) + func (s *Permify) UserHasAnyPermissions(userID uint, p interface{}) (b bool, err error) + func (s *Permify) UserHasAnyRoles(userID uint, r interface{}) (b bool, err error) + func (s *Permify) UserHasDirectPermission(userID uint, p interface{}) (b bool, err error) + func (s *Permify) UserHasPermission(userID uint, p interface{}) (b bool, err error) + func (s *Permify) UserHasRole(userID uint, r interface{}) (b bool, err error)