Get Staff Permission

Function

To get permission of staff by staff id
以 staff id 獲取權限列表

URL

GET <<api_domain>>/v1/staffs/:staff_id/permissions

Request Parameters

ParameterTypeDescriptionExample
staff_idStringStaff ID61235e00800162002de61919

Response Fields

Field

Type

Description

Example

id

String

permission ID
權限ID

61236c9a6ed8bb001ef6877b

has_full_access

Boolean

full access
是否有全部權限

false

channel_id

String

channel ID
實體通路 ID
(有些權限有分channel )

status

String

status
staff 目前的狀態
(目前這隻 API 只會回傳狀態是 active 的 staff)

active

grants

Hash

grants permission
擁有的權限列表

  • {
    "orders": [
    "all"
    ],
    "productscategories":[
    "all"
    ],
    "addon_products": [
    "all"
    ],
    "gifts": [],
    "customers": [],
    "broadcasts": [],
    "membership_tiers": [],
    "user_credits": [],
    "member_points": [],
    "promotions": [],
    "analytics": [],
    "reports": [],
    "marketing": [],
    "pages_navigation": [],
    "express_checkout_pages": [],
    "design": [],
    "blog": [],
    "apps": [],
    "basic_settings": [],
    "deliveries": [],
    "payments": [],
    "order_settings": [],
    "product_settings": [],
    "user_settings": [],
    "custom_notification": [],
    "staff": [],
    "event_trackers": [],
    "billing": [],
    "operational_billing": [],
    "admin_show_action_logs": [],
    "communication_channels": [],
    "kiosk": [],
    "inventory": [],
    "taxes_settings": [],
    "checkout_settings": [],
    "product_cost": []
    }

scope

String

permission scope
權限 scope

admin / open-api

Response Example

{
    "items": [
        {
            "id": "61236c9a6ed8bb001ef6877b",
            "has_full_access": false,
            "channel_id": null,
            "status": "active",
            "grants": {
                "orders": [
                    "all"
                ],
                "products_categories": [
                    "all"
                ],
                "addon_products": [
                    "all"
                ],
                "gifts": [],
                "customers": [],
                "broadcasts": [],
                "membership_tiers": [],
                "user_credits": [],
                "member_points": [],
                "promotions": [],
                "analytics": [],
                "reports": [],
                "marketing": [],
                "pages_navigation": [],
                "express_checkout_pages": [],
                "design": [],
                "blog": [],
                "apps": [],
                "basic_settings": [],
                "deliveries": [],
                "payments": [],
                "order_settings": [],
                "product_settings": [],
                "user_settings": [],
                "custom_notification": [],
                "staff": [],
                "event_trackers": [],
                "billing": [],
                "operational_billing": [],
                "admin_show_action_logs": [],
                "communication_channels": [],
                "kiosk": [],
                "inventory": [],
                "taxes_settings": [],
                "checkout_settings": [],
                "product_cost": []
            },
            "scope": "admin"
        },
        {
            "id": "61236c9b820e260067a90fd6",
            "has_full_access": false,
            "channel_id": null,
            "status": "active",
            "grants": {
                "customers": [
                    "index",
                    "show",
                    "update",
                    "create",
                    "delete",
                    "get_member_points",
                    "update_member_points",
                    "update_store_credit",
                    "search",
                    "membership_info"
                ],
                "custom_fields": [
                    "index"
                ],
                "member_points": [
                    "index",
                    "show"
                ],
                "membership_tiers": [
                    "index"
                ],
                "member_point_rules": [
                    "index"
                ],
                "categories": [
                    "index",
                    "show",
                    "create",
                    "update",
                    "delete",
                    "bulk_assign"
                ],
                "products": [
                    "index",
                    "show",
                    "search",
                    "update_quantity",
                    "update_variation_quantity",
                    "update_price",
                    "update_variation_price",
                    "create",
                    "update_quantity_by_sku",
                    "update",
                    "create_product_variation",
                    "update_product_variation",
                    "delete_product_variation",
                    "add_images",
                    "delete_images",
                    "get_stocks",
                    "update_stocks",
                    "delete",
                    "bulk_update_status",
                    "bulk_update_retail_status",
                    "bulk_delete"
                ],
                "gifts": [
                    "index",
                    "create",
                    "update",
                    "update_quantity",
                    "update_quantity_by_sku",
                    "search",
                    "get_stocks",
                    "update_stocks"
                ],
                "addon_products": [
                    "index",
                    "show",
                    "create",
                    "update",
                    "update_quantity",
                    "update_quantity_by_sku",
                    "search",
                    "get_stocks",
                    "update_stocks"
                ],
                "product_variant_templates": [
                    "index"
                ],
                "orders": [
                    "index",
                    "show",
                    "search",
                    "update_status",
                    "update_delivery_status",
                    "update_payment_status",
                    "update",
                    "create",
                    "show_label",
                    "execute_shipment",
                    "split",
                    "tags",
                    "list_action_logs"
                ],
                "payments": [
                    "index",
                    "show"
                ],
                "delivery_options": [
                    "index",
                    "show",
                    "create",
                    "update",
                    "delete"
                ],
                "warehouses": [
                    "index"
                ],
                "promotions": [
                    "index",
                    "show",
                    "create",
                    "update"
                ],
                "merchants": [
                    "show"
                ],
                "suppliers": [
                    "index"
                ],
                "user_credits": [
                    "index"
                ],
                "category_products": [
                    "index",
                    "bulk_update_priority"
                ],
                "campaigns": [
                    "index",
                    "show",
                    "update"
                ],
                "order_campaign_items": [
                    "index"
                ],
                "product_subscriptions": [
                    "index",
                    "show"
                ],
                "media": [
                    "create"
                ],
                "return_orders": [
                    "index",
                    "show",
                    "create",
                    "update",
                    "delete"
                ],
                "webhooks": [
                    "index",
                    "show",
                    "create",
                    "update",
                    "delete"
                ],
                "bulk_operations": [
                    "index",
                    "show",
                    "create_products"
                ],
                "metafields": [
                    "index",
                    "show",
                    "create",
                    "update",
                    "delete",
                    "bulk_create",
                    "bulk_update",
                    "bulk_delete"
                ],
                "metafield_definitions": [
                    "index",
                    "show",
                    "create",
                    "delete"
                ],
                "taxes": [
                    "index"
                ],
                "settings": [
                    "index",
                    "show"
                ],
                "product_review_comments": [
                    "index",
                    "show"
                ]
            },
            "scope": "open_api"
        }
    ]
}

Q:如何找到 Admin 中的各項權限名稱與 Open API 拿到的 grants 對應?
A:在 Admin 開啟開發者模式,找到截圖中 ID形式的資料打開,就能找到勾選的權限出現對應的 field name。