Documentation ¶
Index ¶
- Variables
- func MockDashboardGuardian(mock *FakeDashboardGuardian)
- type DashboardGuardian
- type FakeDashboardGuardian
- func (g *FakeDashboardGuardian) CanAdmin() (bool, error)
- func (g *FakeDashboardGuardian) CanEdit() (bool, error)
- func (g *FakeDashboardGuardian) CanSave() (bool, error)
- func (g *FakeDashboardGuardian) CanView() (bool, error)
- func (g *FakeDashboardGuardian) CheckPermissionBeforeUpdate(permission m.PermissionType, updatePermissions []*m.DashboardAcl) (bool, error)
- func (g *FakeDashboardGuardian) GetAcl() ([]*m.DashboardAclInfoDTO, error)
- func (g *FakeDashboardGuardian) HasPermission(permission m.PermissionType) (bool, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrGuardianPermissionExists = errors.New("Permission already exists") ErrGuardianOverride = errors.New("You can only override a permission to be higher") )
View Source
var New = func(dashId int64, orgId int64, user *m.SignedInUser) DashboardGuardian { return &dashboardGuardianImpl{ user: user, dashId: dashId, orgId: orgId, log: log.New("guardians.dashboard"), } }
New factory for creating a new dashboard guardian instance
Functions ¶
func MockDashboardGuardian ¶
func MockDashboardGuardian(mock *FakeDashboardGuardian)
Types ¶
type DashboardGuardian ¶
type DashboardGuardian interface { CanSave() (bool, error) CanEdit() (bool, error) CanView() (bool, error) CanAdmin() (bool, error) HasPermission(permission m.PermissionType) (bool, error) CheckPermissionBeforeUpdate(permission m.PermissionType, updatePermissions []*m.DashboardAcl) (bool, error) GetAcl() ([]*m.DashboardAclInfoDTO, error) }
DashboardGuardian to be used for guard against operations without access on dashboard and acl
type FakeDashboardGuardian ¶
type FakeDashboardGuardian struct { DashId int64 OrgId int64 User *m.SignedInUser CanSaveValue bool CanEditValue bool CanViewValue bool CanAdminValue bool HasPermissionValue bool CheckPermissionBeforeUpdateValue bool CheckPermissionBeforeUpdateError error GetAclValue []*m.DashboardAclInfoDTO }
func (*FakeDashboardGuardian) CanAdmin ¶
func (g *FakeDashboardGuardian) CanAdmin() (bool, error)
func (*FakeDashboardGuardian) CanEdit ¶
func (g *FakeDashboardGuardian) CanEdit() (bool, error)
func (*FakeDashboardGuardian) CanSave ¶
func (g *FakeDashboardGuardian) CanSave() (bool, error)
func (*FakeDashboardGuardian) CanView ¶
func (g *FakeDashboardGuardian) CanView() (bool, error)
func (*FakeDashboardGuardian) CheckPermissionBeforeUpdate ¶
func (g *FakeDashboardGuardian) CheckPermissionBeforeUpdate(permission m.PermissionType, updatePermissions []*m.DashboardAcl) (bool, error)
func (*FakeDashboardGuardian) GetAcl ¶
func (g *FakeDashboardGuardian) GetAcl() ([]*m.DashboardAclInfoDTO, error)
func (*FakeDashboardGuardian) HasPermission ¶
func (g *FakeDashboardGuardian) HasPermission(permission m.PermissionType) (bool, error)
Click to show internal directories.
Click to hide internal directories.