rbac

package
v0.0.0-...-acbd0ad Latest Latest
Warning

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

Go to latest
Published: May 8, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RBACManager

type RBACManager struct {
	Tables *db.Tables
}

RBACManager manage RBAC roles and permissions.

func (*RBACManager) Check

func (m *RBACManager) Check(userID, projectID int64, operation string) (bool, error)

Check if user can do operation on project.

func (*RBACManager) CreateRole

func (m *RBACManager) CreateRole(role *models.RoleView) (err error)

CreateRole and set ids.

func (*RBACManager) GetProjectRoleByProjectID

func (m *RBACManager) GetProjectRoleByProjectID(projectID int64) (*models.ProjectRole, error)

func (*RBACManager) GetRoleViewByRoleID

func (m *RBACManager) GetRoleViewByRoleID(roleID int64) (*models.RoleView, error)

func (*RBACManager) GetUserRoleByUserID

func (m *RBACManager) GetUserRoleByUserID(userID int64) (*models.UserRole, error)

GetRolesByUserID returns roles for a user.

type RBACOperationImpl

type RBACOperationImpl struct {
	RBACManager RBACManager
}

RBACOperationImpl Handle rbac related requests.

func (*RBACOperationImpl) GetProjectRBAC

func (r *RBACOperationImpl) GetProjectRBAC(params rbacop.GetProjectRBACParams, principal *models.AuthInfo) middleware.Responder

GetProjectRBAC Get Project RBAC.

func (*RBACOperationImpl) GetUserRBAC

func (r *RBACOperationImpl) GetUserRBAC(params rbacop.GetUserRBACParams, principal *models.AuthInfo) middleware.Responder

GetUserRBAC Get User RBAC.

Jump to

Keyboard shortcuts

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