作者 唐旭辉

提交

... ... @@ -19,7 +19,7 @@ mysql_db_name = "${MYSQL_DB_NAME||opportunity_dev}"
##redis相关配置
redis_add = "${REDIS_HOST||127.0.0.1}"
redis_add_port = "${REDIS_PORT||6379}"
redis_auth = "123456"
redis_auth = ""
##log相关配置
##out_put:"console","file"
log_output = "file"
... ...
package controllers
import "oppmg/protocol"
import (
"oppmg/protocol"
)
type AuditController struct {
BaseController
... ... @@ -21,7 +23,6 @@ func (this *AuditController) AuditList() {
// }
// uid := this.GetUserId()
// companyId := this.GetCompanyId()
msg = protocol.NewReturnResponse(nil, nil)
return
}
... ...
... ... @@ -19,6 +19,7 @@ type PermissionOptionObject interface {
// StringUnmarshal(string) error
// ObjectMarshal() string
GetValidFunc(string) func(UserObject) bool
MergeObject(string) error
}
//PermissionBase 路由对应的权限
... ...
package rbac
import (
"encoding/json"
)
type UserObject struct {
UserId int64 `json:"user_id"`
CompanyId int64 `json:"company_id"`
... ... @@ -37,6 +41,16 @@ func (p *PermissionOptionBase) GetValidFunc(k string) func(UserObject) bool {
return nil
}
func (p *PermissionOptionBase) MergeObject(jsonString string) error {
var obj PermissionBase
err := json.Unmarshal([]byte(jsonString), &obj)
if err != nil {
return err
}
// if o
return nil
}
// //StringUnmarshal PermissionOptionBase 接口实现
// func (p *PermissionOptionBase) StringUnmarshal(s string) error {
// err := json.Unmarshal([]byte(s), p)
... ... @@ -119,6 +133,11 @@ func (p *OptionOpportunity) GetValidFunc(k string) func(UserObject) bool {
return nil
}
//MergeObject PermissionOptionBase 接口实现
func (p *OptionOpportunity) MergeObject(string) error {
return nil
}
func (p *OptionOpportunity) ValidCheck(obj UserObject) bool {
if p.Check > 0 {
return true
... ...