Documentation ¶
Index ¶
- Variables
- func AuthandPermission(accessControl *AccessControl) error
- func Migration(db *gorm.DB)
- func TruncateDescription(description string, limit int) string
- type AccessControl
- func (access *AccessControl) ContentAccessList(limit int, offset int, filter Filter, tenantid int) (accesslist []Tblaccesscontrol, totalCount int64, err error)
- func (access *AccessControl) CreateAccessControl(title string, ModifiedBy int, tenantid int) (accessdata TblAccessControl, aerr error)
- func (access *AccessControl) CreateRestrictEntries(accessid int, membergroups []int, entryids []Entry, createdBy int, ...) error
- func (access *AccessControl) CreateRestrictGroup(accessid int, membergroups []int, ids []int, createdBy int, tenantid int) error
- func (access *AccessControl) CreateRestrictPage(accessid int, membergroups []int, ids []int, createdBy int) error
- func (access *AccessControl) CreateRestrictSubPage(accessid int, membergroups []int, ids []int, createdBy int) error
- func (access *AccessControl) DeleteMemberAccessControl(accessid int, ModifiedBy int, tenantid int) error
- func (access *AccessControl) DeleteSelectedSpaces(accessid int, ids []int, DeletedBy int, tenantid int) error
- func (access *AccessControl) DeleteSeletedGroup(accessid int, ids []int, DeletedBy int, tenantid int) error
- func (access *AccessControl) DeleteSeletedPage(accessid int, ids []int, DeletedBy int, tenantid int) error
- func (access *AccessControl) GetControlAccessById(accessid int, tenantid int) (accesslist Tblaccesscontrol, err error)
- func (access *AccessControl) GetaccessMemberGroup(accessid int, tenantid int) (group []int, err error)
- func (access *AccessControl) GetselectedEntiresByAccessControlId(accessid int, tenantid int) ([]int, []Entry, error)
- func (access *AccessControl) UpdateAccessControl(accessid int, title string, ModifiedBy int, tenantid int) error
- func (access *AccessControl) UpdateRestrictEntries(accessid int, membergroups []int, entryids []Entry, userid int, tenantid int) error
- type AccessModel
- func (AccessModel) CheckPresenceOfAccessGrantedMemberGroups(count *int64, mem_id, accessId int, DB *gorm.DB, tenantid int) error
- func (AccessModel) CheckPresenceOfChannelEntriesInContentAccess(count *int64, accessGroupId, chanId, entryId int, DB *gorm.DB, tenantid int) error
- func (AccessModel) CreateMemberGroupRestrict(access TblAccessControlUserGroup, DB *gorm.DB) (TblAccessControlUserGroup, error)
- func (AccessModel) CreatePage(access *TblAccessControlPages, DB *gorm.DB) error
- func (AccessModel) DeleteAccessControlPages(pg_access *TblAccessControlPages, Id []int, DB *gorm.DB, tenantid int) error
- func (AccessModel) DeleteControlAccess(accesscontrol *TblAccessControl, id int, DB *gorm.DB, tenantid int) error
- func (AccessModel) DeleteGroup(pg_access *TblAccessControlPages, id []int, grpid []int, DB *gorm.DB, ...) error
- func (AccessModel) DeleteInAccessUserGroup(accessusergrp *TblAccessControlUserGroup, Id int, DB *gorm.DB, tenantid int) error
- func (AccessModel) DeletePage(pg_access *TblAccessControlPages, id []int, pgids []int, DB *gorm.DB, ...) error
- func (AccessModel) DeleteSubPage(pg_access *TblAccessControlPages, id []int, spacesid []int, DB *gorm.DB, ...) error
- func (AccessModel) GetAccessGrantedEntries(AccessEntries *[]TblAccessControlPages, accessId int, DB *gorm.DB, ...) error
- func (AccessModel) GetAccessGrantedMemberGroups(memberGroups *[]TblAccessControlUserGroup, accessId int, DB *gorm.DB, ...) error
- func (AccessModel) GetAccessGrantedMemberGroupsList(memgrps *[]int, accessId int, DB *gorm.DB, tenantid int) error
- func (AccessModel) GetContentAccessByAccessId(id int, DB *gorm.DB, tenantid int) (accesscontrol *Tblaccesscontrol, err error)
- func (AccessM AccessModel) GetContentAccessList(limit, offset int, filter Filter, DB *gorm.DB, tenantid int) (contentAccessList []Tblaccesscontrol, count int64, err error)
- func (AccessModel) GetDeleteIdInAccessUserGroup(controlaccessgrp *[]TblAccessControlUserGroup, Id int, DB *gorm.DB, ...) (*[]TblAccessControlUserGroup, error)
- func (AccessModel) GetEntriesCountUnderChannel(count *int64, channelId int, DB *gorm.DB, tenantid int) error
- func (AccessModel) GetGroupsByAccessId(accessid int, DB *gorm.DB, tenantid int) (usergroups []TblAccessControlUserGroup, er error)
- func (AccessModel) GetMemberGroupsByContentAccessMemId(memgrp *member.TblMemberGroup, id int, DB *gorm.DB, tenantid int) error
- func (AccessModel) GetMemberGrpByAccessControlId(memberGrpAccess *[]TblAccessControlUserGroup, content_access_id int, ...) error
- func (AccessModel) GetSelectedEntries(accessId int, DB *gorm.DB, tenantid int) (contentAccessPages []Tblaccesscontrolpages, err error)
- func (AccessModel) GetaccessGrantedEntriesCount(count *int64, accessId int, DB *gorm.DB, tenantid int) error
- func (AccessModel) GetaccessGrantedPageCount(count *int64, accessId int, DB *gorm.DB, tenantid int) error
- func (AccessModel) GrantAccessToMemberGroups(memberGrpAccess *TblAccessControlUserGroup, DB *gorm.DB, tenantid int) error
- func (AccessModel) NewContentAccessEntry(contentAccess *TblAccessControl, DB *gorm.DB) error
- func (AccessModel) RemoveChannelEntriesNotUnderContentAccess(chanAccess *TblAccessControlPages, entryIds []int, DB *gorm.DB, tenantid int) error
- func (AccessModel) RemoveMemberGroupsNotUnderContentAccessRights(memgrp_access *TblAccessControlUserGroup, memgrp_array []int, access_id int, ...) error
- func (AccessModel) UpdateAccessPage(chanAccess *TblAccessControlPages, DB *gorm.DB, tenantid int) error
- func (AccessModel) UpdateContentAccessId(contentAccess *TblAccessControl, DB *gorm.DB, tenantid int) error
- func (AccessModel) UpdateContentAccessMemberGroup(accessmemgrp *TblAccessControlUserGroup, DB *gorm.DB, tenantid int) error
- type Config
- type Entry
- type Filter
- type MemberAccessControlRequired
- type Page
- type PageGroup
- type RestrictGroup
- type RestrictPage
- type RestrictSpace
- type SubPage
- type TblAccessControl
- type TblAccessControlPages
- type TblAccessControlUserGroup
- type Tblaccesscontrol
- type Tblaccesscontrolpages
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrorAuth = errors.New("auth enabled not initialised") ErrorPermission = errors.New("permissions enabled not initialised") CurrentTime, _ = time.Parse("2006-01-02 15:04:05", time.Now().UTC().Format("2006-01-02 15:04:05")) Empty string TenantId, _ = strconv.Atoi(os.Getenv("TENANT_ID")) )
Functions ¶
func AuthandPermission ¶
func AuthandPermission(accessControl *AccessControl) error
func TruncateDescription ¶
Types ¶
type AccessControl ¶
type AccessControl struct { DB *gorm.DB AuthEnable bool PermissionEnable bool Auth *auth.Auth UserId int DataAccess int }
func AccessSetup ¶
func AccessSetup(config Config) *AccessControl
func (*AccessControl) ContentAccessList ¶
func (access *AccessControl) ContentAccessList(limit int, offset int, filter Filter, tenantid int) (accesslist []Tblaccesscontrol, totalCount int64, err error)
List
func (*AccessControl) CreateAccessControl ¶
func (access *AccessControl) CreateAccessControl(title string, ModifiedBy int, tenantid int) (accessdata TblAccessControl, aerr error)
Create Accesscontrol
func (*AccessControl) CreateRestrictEntries ¶
func (*AccessControl) CreateRestrictGroup ¶
func (*AccessControl) CreateRestrictPage ¶
func (*AccessControl) CreateRestrictSubPage ¶
func (*AccessControl) DeleteMemberAccessControl ¶
func (access *AccessControl) DeleteMemberAccessControl(accessid int, ModifiedBy int, tenantid int) error
Delete Accesscontrol
func (*AccessControl) DeleteSelectedSpaces ¶
func (*AccessControl) DeleteSeletedGroup ¶
func (*AccessControl) DeleteSeletedPage ¶
func (*AccessControl) GetControlAccessById ¶
func (access *AccessControl) GetControlAccessById(accessid int, tenantid int) (accesslist Tblaccesscontrol, err error)
Get Access by id
func (*AccessControl) GetaccessMemberGroup ¶
func (access *AccessControl) GetaccessMemberGroup(accessid int, tenantid int) (group []int, err error)
function used to retrieve the access granted member group list
func (*AccessControl) GetselectedEntiresByAccessControlId ¶
func (*AccessControl) UpdateAccessControl ¶
func (*AccessControl) UpdateRestrictEntries ¶
type AccessModel ¶
var Accessmodel AccessModel
func (AccessModel) CheckPresenceOfAccessGrantedMemberGroups ¶
func (AccessModel) CheckPresenceOfAccessGrantedMemberGroups(count *int64, mem_id, accessId int, DB *gorm.DB, tenantid int) error
check membergroup access
func (AccessModel) CheckPresenceOfChannelEntriesInContentAccess ¶
func (AccessModel) CheckPresenceOfChannelEntriesInContentAccess(count *int64, accessGroupId, chanId, entryId int, DB *gorm.DB, tenantid int) error
check access for enteries
func (AccessModel) CreateMemberGroupRestrict ¶
func (AccessModel) CreateMemberGroupRestrict(access TblAccessControlUserGroup, DB *gorm.DB) (TblAccessControlUserGroup, error)
func (AccessModel) CreatePage ¶
func (AccessModel) CreatePage(access *TblAccessControlPages, DB *gorm.DB) error
func (AccessModel) DeleteAccessControlPages ¶
func (AccessModel) DeleteAccessControlPages(pg_access *TblAccessControlPages, Id []int, DB *gorm.DB, tenantid int) error
Delete Access Control Pages tbl
func (AccessModel) DeleteControlAccess ¶
func (AccessModel) DeleteControlAccess(accesscontrol *TblAccessControl, id int, DB *gorm.DB, tenantid int) error
Delete Access Control tbl
func (AccessModel) DeleteGroup ¶
func (AccessModel) DeleteGroup(pg_access *TblAccessControlPages, id []int, grpid []int, DB *gorm.DB, tenantid int) error
func (AccessModel) DeleteInAccessUserGroup ¶
func (AccessModel) DeleteInAccessUserGroup(accessusergrp *TblAccessControlUserGroup, Id int, DB *gorm.DB, tenantid int) error
Delete Access Control User Group tbl
func (AccessModel) DeletePage ¶
func (AccessModel) DeletePage(pg_access *TblAccessControlPages, id []int, pgids []int, DB *gorm.DB, tenantid int) error
func (AccessModel) DeleteSubPage ¶
func (AccessModel) DeleteSubPage(pg_access *TblAccessControlPages, id []int, spacesid []int, DB *gorm.DB, tenantid int) error
func (AccessModel) GetAccessGrantedEntries ¶
func (AccessModel) GetAccessGrantedEntries(AccessEntries *[]TblAccessControlPages, accessId int, DB *gorm.DB, tenantid int) error
func (AccessModel) GetAccessGrantedMemberGroups ¶
func (AccessModel) GetAccessGrantedMemberGroups(memberGroups *[]TblAccessControlUserGroup, accessId int, DB *gorm.DB, tenantid int) error
func (AccessModel) GetAccessGrantedMemberGroupsList ¶
func (AccessModel) GetAccessGrantedMemberGroupsList(memgrps *[]int, accessId int, DB *gorm.DB, tenantid int) error
get access membergroup
func (AccessModel) GetContentAccessByAccessId ¶
func (AccessModel) GetContentAccessByAccessId(id int, DB *gorm.DB, tenantid int) (accesscontrol *Tblaccesscontrol, err error)
func (AccessModel) GetContentAccessList ¶
func (AccessM AccessModel) GetContentAccessList(limit, offset int, filter Filter, DB *gorm.DB, tenantid int) (contentAccessList []Tblaccesscontrol, count int64, err error)
Get all content access list
func (AccessModel) GetDeleteIdInAccessUserGroup ¶
func (AccessModel) GetDeleteIdInAccessUserGroup(controlaccessgrp *[]TblAccessControlUserGroup, Id int, DB *gorm.DB, tenantid int) (*[]TblAccessControlUserGroup, error)
To Get Deleted id in access control user group tbl
func (AccessModel) GetEntriesCountUnderChannel ¶
func (AccessModel) GetGroupsByAccessId ¶
func (AccessModel) GetGroupsByAccessId(accessid int, DB *gorm.DB, tenantid int) (usergroups []TblAccessControlUserGroup, er error)
func (AccessModel) GetMemberGroupsByContentAccessMemId ¶
func (AccessModel) GetMemberGroupsByContentAccessMemId(memgrp *member.TblMemberGroup, id int, DB *gorm.DB, tenantid int) error
func (AccessModel) GetMemberGrpByAccessControlId ¶
func (AccessModel) GetMemberGrpByAccessControlId(memberGrpAccess *[]TblAccessControlUserGroup, content_access_id int, DB *gorm.DB, tenantid int) error
get member groupby acessid
func (AccessModel) GetSelectedEntries ¶
func (AccessModel) GetSelectedEntries(accessId int, DB *gorm.DB, tenantid int) (contentAccessPages []Tblaccesscontrolpages, err error)
func (AccessModel) GetaccessGrantedEntriesCount ¶
func (AccessModel) GetaccessGrantedPageCount ¶
func (AccessModel) GrantAccessToMemberGroups ¶
func (AccessModel) GrantAccessToMemberGroups(memberGrpAccess *TblAccessControlUserGroup, DB *gorm.DB, tenantid int) error
create member group access
func (AccessModel) NewContentAccessEntry ¶
func (AccessModel) NewContentAccessEntry(contentAccess *TblAccessControl, DB *gorm.DB) error
Create Access
func (AccessModel) RemoveChannelEntriesNotUnderContentAccess ¶
func (AccessModel) RemoveChannelEntriesNotUnderContentAccess(chanAccess *TblAccessControlPages, entryIds []int, DB *gorm.DB, tenantid int) error
remove access for entries
func (AccessModel) RemoveMemberGroupsNotUnderContentAccessRights ¶
func (AccessModel) RemoveMemberGroupsNotUnderContentAccessRights(memgrp_access *TblAccessControlUserGroup, memgrp_array []int, access_id int, DB *gorm.DB) error
remove membergroup access
func (AccessModel) UpdateAccessPage ¶
func (AccessModel) UpdateAccessPage(chanAccess *TblAccessControlPages, DB *gorm.DB, tenantid int) error
update accesspage
func (AccessModel) UpdateContentAccessId ¶
func (AccessModel) UpdateContentAccessId(contentAccess *TblAccessControl, DB *gorm.DB, tenantid int) error
func (AccessModel) UpdateContentAccessMemberGroup ¶
func (AccessModel) UpdateContentAccessMemberGroup(accessmemgrp *TblAccessControlUserGroup, DB *gorm.DB, tenantid int) error
update membergroup access
type RestrictGroup ¶
type RestrictPage ¶
type RestrictSpace ¶
type TblAccessControl ¶
type TblAccessControl struct { Id int `gorm:"primaryKey;auto_increment;type:serial"` AccessControlName string `gorm:"type:character varying"` AccessControlSlug string `gorm:"type:character varying"` CreatedOn time.Time `gorm:"type:timestamp without time zone"` CreatedBy int `gorm:"type:integer"` ModifiedOn time.Time `gorm:"type:timestamp without time zone;DEFAULT:NULL"` ModifiedBy int `gorm:"DEFAULT:NULL"` IsDeleted int `gorm:"type:integer"` DeletedOn time.Time `gorm:"type:timestamp without time zone;DEFAULT:NULL"` DeletedBy int `gorm:"DEFAULT:NULL"` TenantId int `gorm:"type:integer"` }
type TblAccessControlPages ¶
type TblAccessControlPages struct { Id int `gorm:"primaryKey;auto_increment;type:serial"` AccessControlUserGroupId int `gorm:"type:integer"` SpacesId int `gorm:"type:integer"` PageGroupId int `gorm:"type:integer"` PageId int `gorm:"type:integer"` CreatedOn time.Time `gorm:"type:timestamp without time zone;DEFAULT:NULL"` CreatedBy int `gorm:"type:integer"` ModifiedOn time.Time `gorm:"type:timestamp without time zone;DEFAULT:NULL"` ModifiedBy int `gorm:"DEFAULT:NULL"` IsDeleted int `gorm:"type:integer"` DeletedOn time.Time `gorm:"type:timestamp without time zone;DEFAULT:NULL"` DeletedBy int `gorm:"DEFAULT:NULL"` ChannelId int `gorm:"type:integer"` EntryId int `gorm:"type:integer"` TenantId int `gorm:"type:integer"` }
type TblAccessControlUserGroup ¶
type TblAccessControlUserGroup struct { Id int `gorm:"primaryKey;auto_increment;type:serial"` AccessControlId int `gorm:"type:integer"` MemberGroupId int `gorm:"type:integer"` CreatedOn time.Time `gorm:"type:timestamp without time zone;DEFAULT:NULL"` CreatedBy int `gorm:"type:integer"` ModifiedOn time.Time `gorm:"type:timestamp without time zone;DEFAULT:NULL"` ModifiedBy int `gorm:"DEFAULT:NULL"` IsDeleted int `gorm:"type:integer"` DeletedOn time.Time `gorm:"type:timestamp without time zone;DEFAULT:NULL"` DeletedBy int `gorm:"DEFAULT:NULL"` TenantId int `gorm:"type:integer"` }
type Tblaccesscontrol ¶
type Tblaccesscontrol struct { Id int `gorm:"primaryKey;auto_increment"` AccessControlName string AccessControlSlug string CreatedOn time.Time CreatedBy int ModifiedOn time.Time `gorm:"DEFAULT:NULL"` ModifiedBy int `gorm:"DEFAULT:NULL"` IsDeleted int DeletedOn time.Time `gorm:"DEFAULT:NULL"` DeletedBy int `gorm:"DEFAULT:NULL"` Username string `gorm:"column:username;<-:false"` Rolename string `gorm:"column:name;<-:false"` MemberGroups []member.TblMemberGroup `gorm:"-"` DateString string `gorm:"-"` AccessGrantedModules []string `gorm:"-"` TenantId int `gorm:"type:int"` }
type Tblaccesscontrolpages ¶
type Tblaccesscontrolpages struct { Id int `gorm:"primaryKey;auto_increment"` AccessControlUserGroupId int SpacesId int PageGroupId int PageId int CreatedOn time.Time CreatedBy int ModifiedOn time.Time `gorm:"DEFAULT:NULL"` ModifiedBy int `gorm:"DEFAULT:NULL"` IsDeleted int DeletedOn time.Time `gorm:"DEFAULT:NULL"` DeletedBy int `gorm:"DEFAULT:NULL"` ParentPageId int `gorm:"column:parent_id;<-:false"` ChannelId int EntryId int TenantId int `gorm:"type:int"` }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.