@@ -38,7 +38,6 @@ func (t *SubjectAPIToken) String() string {
3838var modelFile []byte
3939
4040type Config struct {
41- ManagedResources []string
4241 RolesMap map [Role ][]* Policy
4342 RestrictOrgCreation bool
4443}
@@ -57,7 +56,8 @@ func (e *Enforcer) Enforce(sub string, p *Policy) (bool, error) {
5756// EnforceWithPolicies checks if the required policy exists in the provided list of allowed policies.
5857// This is used for ACL-based authorization (e.g., API tokens) where policies are stored in the database
5958// rather than in Casbin. Returns true if the required policy is found in the allowed list.
60- func (e * Enforcer ) EnforceWithPolicies (sub string , p * Policy , allowedPolicies []* Policy ) (bool , error ) {
59+ // in the future we will use this function to check if the policy is allowed for the subject by running the enforcer with the subject
60+ func (e * Enforcer ) EnforceWithPolicies (_ string , p * Policy , allowedPolicies []* Policy ) (bool , error ) {
6161 for _ , allowed := range allowedPolicies {
6262 if allowed .Resource == p .Resource && allowed .Action == p .Action {
6363 return true , nil
@@ -171,11 +171,6 @@ func doSync(e *Enforcer, c *Config) error {
171171 resource := p [1 ]
172172 action := p [2 ]
173173
174- // if it's not a managed resource, skip deletion
175- if ! slices .Contains (conf .ManagedResources , resource ) {
176- continue
177- }
178-
179174 wantPolicies , ok := conf .RolesMap [Role (role )]
180175 // if the role does not exist in the map, we can delete the policy
181176 if ! ok {
0 commit comments