workflow partial allows
This commit is contained in:
@@ -13,6 +13,17 @@ type Owner struct {
|
||||
Logo string `json:"logo,omitempty" bson:"logo,omitempty"`
|
||||
}
|
||||
|
||||
func VerifyAccess(a Accessor, id string) error {
|
||||
data, _, err := a.LoadOne(id)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if a.ShouldVerifyAuth() && !data.VerifyAuth(a.GetRequest()) {
|
||||
return errors.New("you are not allowed to access :" + a.GetType().String())
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// GenericLoadOne loads one object from the database (generic)
|
||||
func GenericStoreOne(data DBObject, a Accessor) (DBObject, int, error) {
|
||||
data.GenerateID()
|
||||
|
Reference in New Issue
Block a user