https://cerbos.dev logo
#help
Title
# help
a

ANILA SOMAN

06/21/2023, 6:22 AM
Hi, i tried some add, update, disable policy operations. policies are creating, updating and listing successfully but when i tried to disable the policy i am not sure its disabling or not. it is giving success message but in policy table disabled field is still showing 0 after calling the disable api. i tried to disable the human-resource-update policy but its not showing any change
Copy code
func (a Adapter) DeletePolicy(ctx context.Context, in *cerbospb.DeletePolicyPayload) (*cerbospb.DeletePolicyResponse, error) {

    _, err := a.cerbosClient.CerbosAdminClient.DisablePolicy(context.Background(), in.Id)
    if err != nil {
        log.Printf("failed to disable policy: %s", err)
        if statusError, ok := status.FromError(err); ok {
            // Extract gRPC status information
            return nil, status.Errorf(statusError.Code(), "failed to disable policy: %s", statusError.Message())
        }
        return nil, status.Errorf(codes.Internal, "failed to disable policy: %s", err)
    }

    return &cerbospb.DeletePolicyResponse{
        Success: true,
    }, nil
}
c

Charith (Cerbos)

06/21/2023, 6:58 AM
Hmm... do you see any error messages in the Cerbos server logs?
What is the ID you passed to the
DisablePolicy
call?