Home | History | Annotate | Download | only in iam

Lines Matching refs:Policy

32 	Get(ctx context.Context, resource string) (*pb.Policy, error)
33 Set(ctx context.Context, resource string, p *pb.Policy) error
42 func (g *grpcClient) Get(ctx context.Context, resource string) (*pb.Policy, error) {
49 func (g *grpcClient) Set(ctx context.Context, resource string, p *pb.Policy) error {
52 Policy: p,
93 // Policy retrieves the IAM policy for the resource.
94 func (h *Handle) Policy(ctx context.Context) (*Policy, error) {
99 return &Policy{InternalProto: proto}, nil
102 // SetPolicy replaces the resource's current policy with the supplied Policy.
104 // If policy was created from a prior call to Get, then the modification will
105 // only succeed if the policy has not changed since the Get.
106 func (h *Handle) SetPolicy(ctx context.Context, policy *Policy) error {
107 return h.c.Set(ctx, h.resource, policy.InternalProto)
133 // A Policy is a list of Bindings representing roles
136 // The zero Policy is a valid policy with no bindings.
137 type Policy struct {
138 // TODO(jba): when type aliases are available, put Policy into an internal package
143 InternalProto *pb.Policy
149 func (p *Policy) Members(r RoleName) []string {
158 func (p *Policy) HasRole(member string, r RoleName) bool {
164 func (p *Policy) Add(member string, r RoleName) {
168 p.InternalProto = &pb.Policy{}
183 func (p *Policy) Remove(member string, r RoleName) {
212 // Roles returns the names of all the roles that appear in the Policy.
213 func (p *Policy) Roles() []RoleName {
225 func (p *Policy) binding(r RoleName) *pb.Binding {
233 func (p *Policy) bindingIndex(r RoleName) int {