MCPcopy Create free account
hub / github.com/apache/casbin-server / NewAdapter

Method NewAdapter

server/enforcer.go:137–146  ·  view source on GitHub ↗
(ctx context.Context, in *pb.NewAdapterRequest)

Source from the content-addressed store, hash-verified

135}
136
137func (s *Server) NewAdapter(ctx context.Context, in *pb.NewAdapterRequest) (*pb.NewAdapterReply, error) {
138 a, err := newAdapter(in)
139 if err != nil {
140 return nil, err
141 }
142
143 h := s.addAdapter(a)
144
145 return &pb.NewAdapterReply{Handler: int32(h)}, nil
146}
147
148func (s *Server) parseParam(param, matcher string) (interface{}, string) {
149 if strings.HasPrefix(param, "ABAC::") {

Callers 2

TestRBACModelFunction · 0.95
newTestEngineFunction · 0.95

Calls 2

addAdapterMethod · 0.95
newAdapterFunction · 0.85

Tested by 1

TestRBACModelFunction · 0.76