// Show the channel's policy
967280
func (c *CmdChatSetRetention) showTeamChannelHChannel(conv *chat1.ConversationLocal) {
	dui := c.G().UI.GetDumbOutputUI()
	policy := chat1.RetentionPolicy{}
	if conv.ConvRetention != nil {
		policy = *conv.ConvRetention
	}
	typ, err := policy.Typ()
	if err != nil {
		c.println(dui, "unable to get retention type: %v", err)
		return
	}
	var description string
	switch typ {
	case chat1.RetentionPolicyType_NONE, chat1.RetentionPolicyType_INHERIT:
		description = "Uses the team policy"
	default:
		description = policy.HumanSummary()
	}
	c.println(dui, "#%v channel: %v", conv.Info.TopicName, description)
}
188075
func (s *State) GuildChannel(guildID, channelID string) (*Channel, error) {
	return s.Channel(channelID)
}
1217103
func (n *Network) ProfileForChannel(channelName string) string {
	for _, ch := range n.Channels {
		if ch.Name == channelName {
			return ch.Profile
		}
	}
	return ""
}
58762
func (c *UserController) Show(ctx *app.ShowUserContext) error {
	// retrieve the user's identity ID from the token
	identityID, err := c.tokenManager.Locate(ctx)
	if err != nil {
		log.Error(ctx, map[string]interface{}{
			"err": err,
		}, "Bad Token")
		return jsonapi.JSONErrorResponse(ctx, errors.NewUnauthorizedError("bad or missing token"))
	}
	user, identity, err := c.app.UserService().UserInfo(ctx, identityID)
	if err != nil {
		return jsonapi.JSONErrorResponse(ctx, err)
	}
	if user.Banned {
		ctx.ResponseData.Header().Add("Access-Control-Expose-Headers", "WWW-Authenticate")
		ctx.ResponseData.Header().Set("WWW-Authenticate", "DEPROVISIONED description=\"Account has been banned\"")
		return jsonapi.JSONErrorResponse(ctx, errors.NewUnauthorizedError("Account has been banned"))
	}

	return ctx.ConditionalRequest(*user, c.config.GetCacheControlUser, func() error {
		// Init tenant (if access to tenant service is configured/enabled)
		if c.tenantService != nil {
			go func(ctx context.Context) {
				c.tenantService.Init(ctx)
			}(ctx)
		}
		return ctx.OK(ConvertToAppUser(ctx.RequestData, user, identity, true))
	})
}
1124593
func (s *State) PrivateChannel(channelID string) (*Channel, error) {
	return s.Channel(channelID)
}
1118385
func (ctrl Controller) Show(w http.ResponseWriter, req *http.Request) {
	var (
		product        products.Product
		colorVariation products.ColorVariation
		codes          = strings.Split(utils.URLParam("code", req), "_")
		productCode    = codes[0]
		colorCode      string
		tx             = utils.GetDB(req)
	)

	if len(codes) > 1 {
		colorCode = codes[1]
	}

	if tx.Preload("Category").Where(&products.Product{Code: productCode}).First(&product).RecordNotFound() {
		http.Redirect(w, req, "/", http.StatusFound)
	}

	tx.Preload("Product").Preload("Color").Preload("SizeVariations.Size").Where(&products.ColorVariation{ProductID: product.ID, ColorCode: colorCode}).First(&colorVariation)

	ctrl.View.Execute("show", map[string]interface{}{"CurrentColorVariation": colorVariation}, req, w)
}
293214
func encodePolicy(p *Policy) (b64Policy, jsonPolicy []byte, err error) {
	jsonPolicy, err = encodePolicyJSON(p)
	if err != nil {
		return nil, nil, fmt.Errorf("failed to encode policy, %s", err.Error())
	}
	// Remove leading and trailing white space, JSON encoding will note include
	// whitespace within the encoding.
	jsonPolicy = bytes.TrimSpace(jsonPolicy)

	b64Policy = make([]byte, base64.StdEncoding.EncodedLen(len(jsonPolicy)))
	base64.StdEncoding.Encode(b64Policy, jsonPolicy)
	return b64Policy, jsonPolicy, nil
}
805335
func (c *Compiler) WithPolicy(p *ir.Policy) *Compiler {
	c.policy = p
	return c
}
1356366
func ValidatePolicy(policy string) error {
	_, err := casbin.NewEnforcerSafe(newBuiltInModel(), newAdapter("", "", policy))
	if err != nil {
		return fmt.Errorf("policy syntax error: %s", policy)
	}
	return nil
}
178338
func (c RekeyClient) ShowPendingRekeyStatus(ctx context.Context, sessionID int) (err error) {
	__arg := ShowPendingRekeyStatusArg{SessionID: sessionID}
	err = c.Cli.Call(ctx, "keybase.1.rekey.showPendingRekeyStatus", []interface{}{__arg}, nil)
	return
}
1059151
func (c *Connection) policy(policy string) string {
	return "https://" + c.Signature.Region.Glacier + "/-/policies/" + policy
}
199334
func (_m *ChannelPolicyManagerGetter) Manager(channelID string) (policies.Manager, bool) {
	ret := _m.Called(channelID)

	var r0 policies.Manager
	if rf, ok := ret.Get(0).(func(string) policies.Manager); ok {
		r0 = rf(channelID)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(policies.Manager)
		}
	}

	var r1 bool
	if rf, ok := ret.Get(1).(func(string) bool); ok {
		r1 = rf(channelID)
	} else {
		r1 = ret.Get(1).(bool)
	}

	return r0, r1
}
388669
func Convert_v1beta1_PodDisruptionBudgetStatus_To_policy_PodDisruptionBudgetStatus(in *v1beta1.PodDisruptionBudgetStatus, out *policy.PodDisruptionBudgetStatus, s conversion.Scope) error {
	return autoConvert_v1beta1_PodDisruptionBudgetStatus_To_policy_PodDisruptionBudgetStatus(in, out, s)
}
933439
func (m *MockInterface) Policy() v1beta18.PolicyV1beta1Interface {
	ret := m.ctrl.Call(m, "Policy")
	ret0, _ := ret[0].(v1beta18.PolicyV1beta1Interface)
	return ret0
}
751815
func (model Model) ClearPolicy() {
	for _, ast := range model["p"] {
		ast.Policy = nil
	}

	for _, ast := range model["g"] {
		ast.Policy = nil
	}
}
1230382
func (o *Link) PolicyStatements(info *bambou.FetchingInfo) (PolicyStatementsList, *bambou.Error) {

	var list PolicyStatementsList
	err := bambou.CurrentSession().FetchChildren(o, PolicyStatementIdentity, &list, info)
	return list, err
}
955672
func (c *MockConfig) ChannelConfig(channelID string) *fab.ChannelEndpointConfig {
	if c.chConfig != nil {
		config, ok := c.chConfig[channelID]
		if ok {
			return config
		}
	}

	return &fab.ChannelEndpointConfig{
		Policies: fab.ChannelPolicies{
			QueryChannelConfig: fab.QueryChannelConfigPolicy{},
			Discovery:          fab.DiscoveryPolicy{},
			Selection:          fab.SelectionPolicy{},
			EventService:       fab.EventServicePolicy{},
		},
	}
}