// IsAllowed check if current user has permission to view the action
IsAllowed check if current user has permission to view the action
// IsAllowed check if current user has permission to view the action
func (action Action) IsAllowed(mode roles.PermissionMode, context *Context, records ...interface{}) bool {
	if action.Visible != nil {
		for _, record := range records {
			if !action.Visible(record, context) {
				return false
			}
		}
	}
	if action.Permission != nil {
		return action.HasPermission(mode, context.Context)
	}
	if context.Resource != nil {
		return context.Resource.HasPermission(mode, context.Context)
	}
	return true
}
func ( action Action ) IsAllowed ( mode roles . PermissionMode , context * Context , records ... interface { } ) bool { if action . Visible != nil { for _ , record := range records { if ! action . Visible ( record , context ) { return false } } } if action . Permission != nil { return action . HasPermission ( mode , context . Context ) } if context . Resource != nil { return context . Resource . HasPermission ( mode , context . Context ) } return true }
IsAllowed check if current user has permission to view the action
IsAllowed check if current user has permission to view the action