forked from ribice/gorsk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
auth.go
27 lines (23 loc) · 737 Bytes
/
auth.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package gorsk
import (
"github.com/labstack/echo"
)
// AuthToken holds authentication token details with refresh token
type AuthToken struct {
Token string `json:"token"`
RefreshToken string `json:"refresh_token"`
}
// RefreshToken holds authentication token details
type RefreshToken struct {
Token string `json:"token"`
}
// RBACService represents role-based access control service interface
type RBACService interface {
User(echo.Context) AuthUser
EnforceRole(echo.Context, AccessRole) error
EnforceUser(echo.Context, int) error
EnforceCompany(echo.Context, int) error
EnforceLocation(echo.Context, int) error
AccountCreate(echo.Context, AccessRole, int, int) error
IsLowerRole(echo.Context, AccessRole) error
}