Permission Groups

Overview

Permission groups are a resource of a DudaPro account. Groups set the exact features that Staff members will have access to. Each group has a set of Permissions that defines the exact features a Staff member can access while logged into their account. Staff accounts must be assigned to a group in order to access the platform and can only be assigned to one group at a time.

Resource URIs

  • Get All Default Groups

    As part of the Permission Groups, Duda provides a set of default (predefined) groups that cannot be edited. These groups are set by Duda and are available for everyone to use. The big advantage of using the default groups is that they will be updated in the future as new features are released by Duda. If you create your own Custom groups, Duda will not automatically add the feature to your Custom group.

    GET /permission-groups/default

    Expected Return:

    HTTP Status Code: 200 OK

    JSON Returned:

    [{
        "group_name": "administrator",
        "color": "rgb(253,113,34)",
        "title": "Admin",
        "permissions": ["EDIT", "CREATE", "DELETE", "API", "DUDA_PRO", "MANAGE_USERS", "STATS", "E_COMMERCE", "MARKETING", "REPUBLISH", "PUBLISH", "DEV_MODE", "SITE_CUSTOM_DOMAIN"]
    }, {
        "group_name": "salesman",
        "color": "rgb(36,206,151)",
        "title": "Sales",
        "permissions": ["CREATE", "MARKETING", "STATS", "REPUBLISH", "EDIT", "E_COMMERCE"]
    }, {
        "group_name": "designer",
        "color": "rgb(21,193,191)",
        "title": "Designer",
        "permissions": ["CREATE", "MARKETING", "REPUBLISH", "EDIT", "E_COMMERCE"]
    }, {
        "group_name": "storemanager",
        "color": "rgb(53,188,221)",
        "title": "Store Manager",
        "permissions": ["E_COMMERCE"]
    }]
    

    Possible Errors:

    AccessForbidden

    CURL Example:

    curl -S -u 'APIusername:APIpassword' -H 'Content-Type: application/json' -X GET -i -k https://api.dudamobile.com/api/permission-groups/default
  • Get Custom Group Details

    Get all Custom Groups that have been created for this account.

    GET /permission-groups/custom

    Expected Return:

    HTTP Status Code: 200 OK

    JSON Returned:

    An array of objects will be returned with all Custom groups created.

    [{
        "group_name": "Mzc0MQ",
        "color": "rgb(27,245,71)",
        "title": "Outside Sales",
        "permissions": ["STATS", "CREATE", "REPUBLISH", "EDIT"]
    }, {
        "group_name": "MzczNQ",
        "color": "rgb(45,101,152)",
        "title": "QA",
        "permissions": ["PUBLISH", "REPUBLISH", "EDIT"]
    }]
    

    Possible Errors:

    AccessForbidden

    CURL Example:

    curl -S -u 'APIusername:APIpassword' -H 'Content-Type: application/json' -X GET -i -k https://api.dudamobile.com/api/permission-groups/custom
  • Create a Custom Staff Permission Group

    Create a new Staff Group. This Group defines the features that a Staff member will have access to when logging into their account. When creating a custom group, Duda recommends storing the group_name value for future reference.

    POST /permission-groups/create

    Body Data Parameters

    Property Type Description
    title string A short title to describe the group being created. (required)
    color RGB/HEX color A hex or RGB color code to associate the group with. For example, #2d6598 or rgb(45,101,152). (optional)
    permissions array An array of strings that set the permissions for this group. (required)

    JSON example to send

    {
        "color": "rgb(27,245,71)",
        "title": "Outside Sales",
        "permissions": ["STATS", "CREATE", "REPUBLISH", "EDIT"]
    }
    

    Expected Return:

    HTTP Status Code: 200 OK

    JSON Returned:

    The name of the group will be returned as a JSON object.

    {
    "group_name":"MjAwMg"
    }
    

    Possible Errors:

    AccessForbidden
    InvalidInput

    CURL Example:

    curl -S -u 'APIusername:APIpassword' -H 'Content-Type: application/json' -X POST -i -k https://api.dudamobile.com/api/permission-groups/create -d '{"group_name": "Mzc0MQ","color": "rgb(27,245,71)","title": "Outside Sales","permissions":["STATS", "CREATE", "REPUBLISH", "EDIT"]}' 
  • Update a Custom Staff Permission Group

    Update an existing group. Use this if you want to change the features that a certain Staff Group has access to, change the title (name) of the group or set a new color to apply to the group.

    POST /permission-groups/{group_name}/update

    Body Data Parameters

    JSON example to send:

    {
      "title": "Outside Sales",
      "color": "#85144b",
      "permissions": [
        "PRO_SETTINGS",
        "STATS",
        "MANAGE_STAFF",
        "CREATE_SITES",
        "DELETE_SITES",
        "MARKETING",
        "E_COMMERCE",
        "PUBLISH",
        "DEV_MODE",
        "EDIT_SITES",
        "CUSTOM_DOMAIN",
        "REPUBLISH"
      ]
    }
    

    Expected Return:

    HTTP Status Code: 204 No Content

    Possible Errors:

    AccessForbidden
    InvalidInput

    CURL Example:

    curl -S -u 'APIusername:APIpassword' -H 'Content-Type: application/json' -X POST -i -k https://api.dudamobile.com/api/permission-groups/Mzc0MQ/update -d '{"group_name": "Mzc0MQ","color": "rgb(27,245,71)","title": "Outside Sales","permissions":["STATS", "CREATE", "REPUBLISH", "EDIT"]}' 
  • Get Permissions for Staff Group

    Get the details of a specific Permission Group.

    GET /permission-groups/{group_name}

    Required Parameters:

    • group_name - A unique Duda-generated name that applies to this group

    Expected Return:

    HTTP Status Code: 200 OK

    JSON Returned:

    The name of the group will be returned as a JSON object.

    {
      "title": "Outside Sales",
      "color": "#85144b",
      "permissions": [
        "PRO_SETTINGS",
        "STATS",
        "MANAGE_STAFF",
        "CREATE_SITES",
        "DELETE_SITES",
        "MARKETING",
        "E_COMMERCE",
        "PUBLISH",
        "DEV_MODE",
        "EDIT_SITES",
        "CUSTOM_DOMAIN",
        "REPUBLISH"
      ]
    }
    

    Possible Errors:

    AccessForbidden
    InvalidInput

    CURL Example:

    curl -S -u 'APIusername:APIpassword' -H 'Content-Type: application/json' -X GET -i -k https://api.dudamobile.com/api/permission-groups/Mzc0MQ 
  • Delete a Custom Group

    Delete an existing Custom Group. This action cannot be undone.

    DELETE /permission-groups/{group_name}

    Required Parameters:

    • group_name - A unique Duda-generated name that applies to this group

    Expected Return:

    HTTP Status Code: 204 No Content

    Possible Errors:

    AccessForbidden
    ResourceNotExist
    InvalidInput

    CURL Example:

    curl -S -u 'APIusername:APIpassword' -H 'Content-Type: application/json' -X DELETE -i -k https://api.dudamobile.com/api/permission-groups/Mzc0MQ 
  • Assign a Staff Account to a Group

    Assign a Staff Account to a specific group. Both the custom group and Staff account must exist already. The account must be defined as a Staff account. If this Staff acconut is already assigned to a group, they will be reassigned to the new group instead.

    POST /permission-groups/{group_name}/accounts/{account_name}/add

    Required Parameters:

    • group_name - A unique Duda-generated name that applies to this group
    • account_name - A unique account name that was set while originally creating the account (usually an email address)

    Expected Return:

    HTTP Status Code: 204 No Content

    Possible Errors:

    AccessForbidden
    ResourceNotExist
    InvalidInput

    CURL Example:

    curl -S -u 'APIusername:APIpassword' -H 'Content-Type: application/json' -X POST -i -k https://api.dudamobile.com/api/permission-groups/Mzc0MQ/accounts/john-smith@gmail.com/add
  • Remove Staff Account from a Group

    Remove a Staff account from the group that they are currently assigned to. Please note that this will prevent them from logging in, as Staff account must be assigned to a group to log in.

    DELETE /permission-groups/{group_name}/accounts/{account_name}

    Required Parameters:

    • group_name - A unique Duda-generated name that applies to this group
    • account_name - A unique account name that was set while originally creating the account (usually an email address)

    Expected Return:

    HTTP Status Code: 204 No Content

    Possible Errors:

    AccessForbidden
    ResourceNotExist

    CURL Example:

    curl -S -u 'APIusername:APIpassword' -H 'Content-Type: application/json' -X POST -i -k https://api.dudamobile.com/api/permission-groups/Mzc0MQ/accounts/john-smith@gmail.com/add
×

Priority Phone Support

English phone support is available 18 hours a day,
Monday through Friday, 3am to 9pm (EST).

United States +1 866-776-1550 3am to 9pm (Eastern)
United Kingdom +44 (0)800-011-9071 8am to 2am (London)
France +33 (0)9-75-18-84-74 9am to 3am (Paris)
Israel +972 (0)3-720-8922 10am to 4am (Jerusalem)
Australia +61 (0)2-8880-9166 7pm to 1pm (Sydney)
To schedule a call in French, Portuguese, Hebrew or Russian, please email us at prioritysupport@dudamobile.com
×

Please Log in as a DudaPro

Priority Phone Support is available exclusively to DudaPros. Log in to your DudaPro account now to see our international support numbers.

Log In
Not a DudaPro? Start a free trial now!