From b35b63f56a7fe503548f9b0231215f70a7ec8fcc Mon Sep 17 00:00:00 2001 From: Brooke Bryan Date: Tue, 15 Aug 2017 19:55:16 +0100 Subject: [PATCH] Always prepend the project ID when checking permissions and roles --- portcullis.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/portcullis.go b/portcullis.go index b6cb624..7d8568b 100644 --- a/portcullis.go +++ b/portcullis.go @@ -65,7 +65,7 @@ func (r *ReqInfo) GlobalAppID() string { // HasRole check if the user has a specific role func (r *ReqInfo) HasRole(checkRole string) bool { for _, role := range r.Roles { - if role == checkRole { + if role == r.ProjectID+"/"+checkRole { return true } } @@ -75,7 +75,7 @@ func (r *ReqInfo) HasRole(checkRole string) bool { // HasPermission check if the user has a specific permission func (r *ReqInfo) HasPermission(checkPermission string) bool { for _, permission := range r.Permissions { - if permission == checkPermission { + if permission == r.ProjectID+"/"+checkPermission { return true } }