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

Change access folder structure #4359

Merged
merged 8 commits into from
Jul 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/spicy-sheep-eat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'openzeppelin-solidity': major
---

`access`: Move `AccessControl` extensions to a dedicated directory.
6 changes: 5 additions & 1 deletion contracts/access/README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This directory provides ways to restrict who can access the functions of a contr
- {AccessControl} provides a general role based access control mechanism. Multiple hierarchical roles can be created and assigned each to multiple accounts.
- {Ownable} is a simpler mechanism with a single owner "role" that can be assigned to a single account. This simpler mechanism can be useful for quick tests but projects with production concerns are likely to outgrow it.

== Authorization
== Core

{{Ownable}}

Expand All @@ -18,8 +18,12 @@ This directory provides ways to restrict who can access the functions of a contr

{{AccessControl}}

== Extensions

{{IAccessControlEnumerable}}

{{AccessControlEnumerable}}

{{IAccessControlDefaultAdminRules}}

{{AccessControlDefaultAdminRules}}
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@

pragma solidity ^0.8.19;

import {AccessControl, IAccessControl} from "./AccessControl.sol";
import {IAccessControlDefaultAdminRules} from "./IAccessControlDefaultAdminRules.sol";
import {SafeCast} from "../utils/math/SafeCast.sol";
import {Math} from "../utils/math/Math.sol";
import {IERC5313} from "../interfaces/IERC5313.sol";
import {AccessControl, IAccessControl} from "../AccessControl.sol";
import {SafeCast} from "../../utils/math/SafeCast.sol";
import {Math} from "../../utils/math/Math.sol";
import {IERC5313} from "../../interfaces/IERC5313.sol";

/**
* @dev Extension of {AccessControl} that allows specifying special rules to manage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
pragma solidity ^0.8.19;

import {IAccessControlEnumerable} from "./IAccessControlEnumerable.sol";
import {AccessControl} from "./AccessControl.sol";
import {EnumerableSet} from "../utils/structs/EnumerableSet.sol";
import {AccessControl} from "../AccessControl.sol";
import {EnumerableSet} from "../../utils/structs/EnumerableSet.sol";

/**
* @dev Extension of {AccessControl} that allows enumerating the members of each role.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

pragma solidity ^0.8.19;

import {IAccessControl} from "./IAccessControl.sol";
import {IAccessControl} from "../IAccessControl.sol";

/**
* @dev External interface of AccessControlDefaultAdminRules declared to support ERC165 detection.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

pragma solidity ^0.8.19;

import {IAccessControl} from "./IAccessControl.sol";
import {IAccessControl} from "../IAccessControl.sol";

/**
* @dev External interface of AccessControlEnumerable declared to support ERC165 detection.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const { time, constants, expectRevert } = require('@openzeppelin/test-helpers');
const {
shouldBehaveLikeAccessControl,
shouldBehaveLikeAccessControlDefaultAdminRules,
} = require('./AccessControl.behavior.js');
} = require('../AccessControl.behavior.js');

const AccessControlDefaultAdminRules = artifacts.require('$AccessControlDefaultAdminRules');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const {
DEFAULT_ADMIN_ROLE,
shouldBehaveLikeAccessControl,
shouldBehaveLikeAccessControlEnumerable,
} = require('./AccessControl.behavior.js');
} = require('../AccessControl.behavior.js');

const AccessControlEnumerable = artifacts.require('$AccessControlEnumerable');

Expand Down