Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the ability to export/import access policies #130

Closed
aamplugin opened this issue Jun 19, 2020 · 1 comment
Closed

Add the ability to export/import access policies #130

aamplugin opened this issue Jun 19, 2020 · 1 comment
Assignees
Milestone

Comments

@aamplugin
Copy link
Owner

Current AAM exports and imports only access settings, however, it would be nice to be able to include also access policies.

@aamplugin aamplugin self-assigned this Jun 19, 2020
@aamplugin aamplugin added this to the 6.6.0 - AAM milestone Jun 23, 2020
@aamplugin
Copy link
Owner Author

The new exported settings contain policies property with the array of used access policies. For example:

{
    "version": "6.6.0",
    "plugin": "advanced-access-manager",
    "timestamp": "1593710635",
    "dataset": {
        "settings": {
            "role": {
                "author": []
            }
        },
        "policies": {
            "4435": {
                "policy": "{\"Version\":\"1.0.0\",\"Dependency\":{\"wordpress\":\">=5.0.0\",\"advanced-access-manager\":\">=6.2.1\",\"aam-enhanced-access-policy\":{\"Name\":\"AAM Enhanced Access Policy\",\"URL\":\"https:\\\/\\\/aamplugin.com\\\/dw\\\/aam-enhanced-access-policy.zip\",\"Version\":\">=0.0.1\",\"GitHub\":\"https:\\\/\\\/github.com\\\/aamplugin\\\/aam-enhanced-access-policy\"},\"${CONST.AAM_PLUS_PACKAGE}\":{\"Name\":\"Plus Package\",\"Version\":\">=5.2.0\",\"URL\":\"https:\\\/\\\/aamplugin.com\\\/pricing\\\/plus-package\"}},\"Statement\":{\"Effect\":\"deny\",\"Resource\":\"PostType:${POLICY_META.postType}:posts\",\"Action\":\"Create\",\"Condition\":{\"GreaterOrEquals\":{\"${CALLBACK.AAM\\\\AddOn\\\\EnhancedAccessPolicy\\\\Author\\\\Content::getPostCount}\":\"${POLICY_META.threshold}\"}}},\"Param\":[{\"Key\":\"EnhancedAccessPolicy:Author:Content:PostType\",\"Value\":\"${POLICY_META.postType}\"},{\"Key\":\"EnhancedAccessPolicy:Author:Content:PublicOnly\",\"Value\":\"(*bool)${POLICY_META.publicOnly}\"}]}",
                "title": "Limit number of posts user can create",
                "description": "Limit the number of public posts that user can create (default is 5)",
                "assignee": {
                    "role:author": true
                }
            }
        },
        "config": [],
        "configpress": []
    }
}

aamplugin pushed a commit that referenced this issue Jul 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant