Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,19 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you 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
#
# https://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.

lib
examples
17 changes: 17 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you 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
//
// https://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.

{
"parser": "@typescript-eslint/parser",
"extends": ["plugin:@typescript-eslint/recommended", "prettier/@typescript-eslint", "plugin:prettier/recommended"],
Expand Down
17 changes: 17 additions & 0 deletions .github/semantic.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,19 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you 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
#
# https://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.

# Always validate the PR title AND all the commits
titleAndCommits: true
16 changes: 16 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you 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
#
# https://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.
.idea
.vscode
node_modules
Expand Down
163 changes: 163 additions & 0 deletions .rat-excludes
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you 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
#
# https://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.

# Empty file; no creative content
.gitattributes
# Strict JSON metadata/configuration; covered by root legal files
.prettierrc
# Project-contributed logo; history reviewed separately
casbin-logo.png
# Policy fixture data: header would become a policy rule
examples/abac_rule_effect_policy.csv
# Policy fixture data: header would become a policy rule
examples/abac_rule_policy.csv
# Policy fixture data: header would become a policy rule
examples/basic_inverse_policy.csv
# Policy fixture data: header would become a policy rule
examples/basic_keyget2_policy.csv
# Policy fixture data: header would become a policy rule
examples/basic_policy.csv
# Policy fixture data: header would become a policy rule
examples/basic_without_resources_policy.csv
# Policy fixture data: header would become a policy rule
examples/basic_without_users_policy.csv
# Policy fixture data: header would become a policy rule
examples/glob_policy.csv
# Policy fixture data: header would become a policy rule
examples/ipmatch_policy.csv
# Policy fixture data: header would become a policy rule
examples/issues/node_casbin_150_policy.csv
# Policy fixture data: header would become a policy rule
examples/keymatch2_policy.csv
# Policy fixture data: header would become a policy rule
examples/keymatch_policy.csv
# Policy fixture data: header would become a policy rule
examples/mulitple_policy.csv
# Policy fixture data: header would become a policy rule
examples/multiple_policy_definitions_policy.csv
# Policy fixture data: header would become a policy rule
examples/priority_indeterminate_policy.csv
# Policy fixture data: header would become a policy rule
examples/priority_policy.csv
# Policy fixture data: header would become a policy rule
examples/priority_policy_explicit.csv
# Policy fixture data: header would become a policy rule
examples/priority_policy_explicit_update.csv
# Policy fixture data: header would become a policy rule
examples/rbac_g2_policy.csv
# Policy fixture data: header would become a policy rule
examples/rbac_policy.csv
# Policy fixture data: header would become a policy rule
examples/rbac_with_all_pattern_policy.csv
# Policy fixture data: header would become a policy rule
examples/rbac_with_deny_policy.csv
# Policy fixture data: header would become a policy rule
examples/rbac_with_domain_pattern_in_policy_policy.csv
# Policy fixture data: header would become a policy rule
examples/rbac_with_domain_pattern_policy.csv
# Policy fixture data: header would become a policy rule
examples/rbac_with_domains_policy.csv
# Policy fixture data: header would become a policy rule
examples/rbac_with_domains_policy2.csv
# Policy fixture data: header would become a policy rule
examples/rbac_with_hierarchical_domains_policy.csv
# Policy fixture data: header would become a policy rule
examples/rbac_with_hierarchy_policy.csv
# Policy fixture data: header would become a policy rule
examples/rbac_with_hierarchy_with_domains_policy.csv
# Policy fixture data: header would become a policy rule
examples/rbac_with_multiple_policy_policy.csv
# Policy fixture data: header would become a policy rule
examples/rbac_with_pattern_policy.csv
# Policy fixture data: header would become a policy rule
examples/rbac_with_resource_roles_policy.csv
# Policy fixture data: header would become a policy rule
examples/subject_priority_policy.csv
# Policy fixture data: header would become a policy rule
examples/subject_priority_policy_simple.csv
# Policy fixture data: header would become a policy rule
examples/subject_priority_policy_with_domain.csv
# Strict JSON metadata/configuration; covered by root legal files
package.json
# Dependency-manager generated resolution data
yarn.lock
# Simple model configuration fixture; original bytes retained
examples/abac_model.conf
# Simple model configuration fixture; original bytes retained
examples/abac_not_using_policy_model.conf
# Simple model configuration fixture; original bytes retained
examples/abac_rule_model.conf
# Simple model configuration fixture; original bytes retained
examples/basic_keyget2_model.conf
# Simple model configuration fixture; original bytes retained
examples/basic_model.conf
# Simple model configuration fixture; original bytes retained
examples/basic_with_root_model.conf
# Simple model configuration fixture; original bytes retained
examples/basic_without_resources_model.conf
# Simple model configuration fixture; original bytes retained
examples/basic_without_users_model.conf
# Simple model configuration fixture; original bytes retained
examples/glob_model.conf
# Simple model configuration fixture; original bytes retained
examples/in_operator_model.conf
# Simple model configuration fixture; original bytes retained
examples/ipmatch_model.conf
# Simple model configuration fixture; original bytes retained
examples/issues/node_casbin_150_model.conf
# Simple model configuration fixture; original bytes retained
examples/keymatch2_model.conf
# Simple model configuration fixture; original bytes retained
examples/keymatch_custom_model.conf
# Simple model configuration fixture; original bytes retained
examples/keymatch_model.conf
# Simple model configuration fixture; original bytes retained
examples/multiple_policy_definitions_model.conf
# Simple model configuration fixture; original bytes retained
examples/priority_model.conf
# Simple model configuration fixture; original bytes retained
examples/priority_model_explicit.conf
# Simple model configuration fixture; original bytes retained
examples/rbac_g2_model.conf
# Simple model configuration fixture; original bytes retained
examples/rbac_model.conf
# Simple model configuration fixture; original bytes retained
examples/rbac_with_all_pattern_model.conf
# Simple model configuration fixture; original bytes retained
examples/rbac_with_deny_model.conf
# Simple model configuration fixture; original bytes retained
examples/rbac_with_domain_pattern_in_policy_model.conf
# Simple model configuration fixture; original bytes retained
examples/rbac_with_domain_pattern_model.conf
# Simple model configuration fixture; original bytes retained
examples/rbac_with_domains_model.conf
# Simple model configuration fixture; original bytes retained
examples/rbac_with_hierarchical_domains_model.conf
# Simple model configuration fixture; original bytes retained
examples/rbac_with_multiple_policy_model.conf
# Simple model configuration fixture; original bytes retained
examples/rbac_with_not_deny_model.conf
# Simple model configuration fixture; original bytes retained
examples/rbac_with_pattern_model.conf
# Simple model configuration fixture; original bytes retained
examples/rbac_with_resource_roles_model.conf
# Simple model configuration fixture; original bytes retained
examples/subject_priority_model.conf
# Simple model configuration fixture; original bytes retained
examples/subject_priority_model_with_domain.conf
# Simple INI parser input fixture; original bytes retained
test/config/testini.ini
8 changes: 8 additions & 0 deletions NOTICE
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,11 @@ The Apache Software Foundation (https://www.apache.org/).

Portions of this software were originally developed by the Casbin project.
Copyright 2017-2026 The casbin Authors.
Copyright 2017 The casbin Authors. All Rights Reserved.
Copyright 2018 The Casbin Authors. All Rights Reserved.
Copyright 2019 The Casbin Authors. All Rights Reserved.
Copyright 2020 The Casbin Authors. All Rights Reserved.
Copyright 2021 The Casbin Authors. All Rights Reserved.
Copyright 2022 The Casbin Authors. All Rights Reserved.
Copyright 2023 The Casbin Authors. All Rights Reserved.
Copyright 2026 The Casbin Authors. All Rights Reserved.
16 changes: 16 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you 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
//
// https://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.
module.exports = {
testEnvironment: 'node',
transform: {
Expand Down
25 changes: 14 additions & 11 deletions src/cachedEnforcer.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
// Copyright 2020 The Casbin Authors. All Rights Reserved.
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you 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
//
// 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
// https://www.apache.org/licenses/LICENSE-2.0
//
// 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.
// 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.

import { Enforcer, NewEnforcerParams, newEnforcerWithClass } from './enforcer';

Expand Down
25 changes: 14 additions & 11 deletions src/config.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
// Copyright 2018 The Casbin Authors. All Rights Reserved.
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you 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
//
// 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
// https://www.apache.org/licenses/LICENSE-2.0
//
// 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.
// 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.

import { FileSystem, mustGetDefaultFileSystem } from './persist';

Expand Down
25 changes: 14 additions & 11 deletions src/constants.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
// Copyright 2022 The Casbin Authors. All Rights Reserved.
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you 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
//
// 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
// https://www.apache.org/licenses/LICENSE-2.0
//
// 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.
// 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.

export const enum EffectExpress {
ALLOW = 'some(where (p_eft == allow))',
Expand Down
Loading
Loading