mirror of
https://github.com/goharbor/harbor.git
synced 2024-09-28 13:27:31 +02:00
2a243ef7a2
1. Introduce `Evaluator` interface which do the permission checking. 2. `admin`, `lazy`, `rbac`, `namespace` and `evaluartor` set are implemented the `Evaluator` interface. 3. Move project rbac implemention from `project` to `rbac` pkg to reduce the name conflict with project instance of model. 4. Do permission checking in security context by `Evaluator`. 5. Cache the regexp in rbac evaluator for casbin. 6. Cache evaluator in namespace evaluator to improve performance. Signed-off-by: He Weiwei <hweiwei@vmware.com>
26 lines
814 B
Go
26 lines
814 B
Go
// Copyright Project Harbor Authors
|
|
//
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
// you may not use this file except in compliance with the License.
|
|
// You may obtain a copy of the License at
|
|
//
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
//
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
// See the License for the specific language governing permissions and
|
|
// limitations under the License.
|
|
|
|
package rbac
|
|
|
|
import (
|
|
"github.com/goharbor/harbor/src/pkg/permission/types"
|
|
)
|
|
|
|
// Resource alias type for types.Resource
|
|
type Resource = types.Resource
|
|
|
|
// Action alias type for types.Action
|
|
type Action = types.Action
|