From bf51e5ee889a96124f7d81177a53b9bb5ce56d64 Mon Sep 17 00:00:00 2001 From: andreas Date: Thu, 8 Nov 2018 04:57:54 +0800 Subject: [PATCH] add punctuation on casbin doc --- auth/casbin/middleware.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/auth/casbin/middleware.go b/auth/casbin/middleware.go index 227a7169f..fdbf6dc31 100644 --- a/auth/casbin/middleware.go +++ b/auth/casbin/middleware.go @@ -13,37 +13,37 @@ type contextKey string const ( // CasbinModelContextKey holds the key to store the access control model // in context, it can be a path to configuration file or a casbin/model - // Model + // Model. CasbinModelContextKey contextKey = "CasbinModel" // CasbinPolicyContextKey holds the key to store the access control policy // in context, it can be a path to policy file or an implementation of - // casbin/persist Adapter interface + // casbin/persist Adapter interface. CasbinPolicyContextKey contextKey = "CasbinPolicy" // CasbinEnforcerContextKey holds the key to retrieve the active casbin - // Enforcer + // Enforcer. CasbinEnforcerContextKey contextKey = "CasbinEnforcer" ) var ( // ErrModelContextMissing denotes a casbin model was not passed into - // the parsing of middleware's context + // the parsing of middleware's context. ErrModelContextMissing = errors.New("CasbinModel is required in context") // ErrPolicyContextMissing denotes a casbin policy was not passed into - // the parsing of middleware's context + // the parsing of middleware's context. ErrPolicyContextMissing = errors.New("CasbinPolicy is required in context") // ErrUnauthorized denotes the subject is not authorized to do the action - // intended on the given object, based on the context model and policy + // intended on the given object, based on the context model and policy. ErrUnauthorized = errors.New("Unauthorized Access") ) // NewEnforcer checks whether the subject is authorized to do the specified -// action on the given object. If a valid access controlmodel and policy +// action on the given object. If a valid access control model and policy // is given, then the generated casbin Enforcer is stored in the context -// with CasbinEnforcer as the key +// with CasbinEnforcer as the key. func NewEnforcer( subject string, object interface{}, action string, ) endpoint.Middleware {