NodeGrantDatabaseStorage
class NodeGrantDatabaseStorage implements NodeGrantDatabaseStorageInterface (View source)
Defines a storage handler class that handles the node grants system.
This is used to build node query access.
Properties
| protected Connection | $database | The database connection. |
|
| protected ModuleHandlerInterface | $moduleHandler | The module handler. |
|
| protected LanguageManagerInterface | $languageManager | The language manager. |
Methods
Constructs a NodeGrantDatabaseStorage object.
Determines access to nodes based on node grants.
Alters a query when node access is required.
Writes a list of grants to the database, deleting previously saved ones.
Deletes all node access entries.
Creates the default node access grant entry.
Counts available node grants.
Remove the access records belonging to certain nodes.
Creates a query condition from an array of node access grants.
Details
__construct(Connection $database, ModuleHandlerInterface $module_handler, LanguageManagerInterface $language_manager)
Constructs a NodeGrantDatabaseStorage object.
AccessResultInterface
access(NodeInterface $node, string $operation, AccountInterface $account)
Determines access to nodes based on node grants.
int
checkAll(AccountInterface $account)
Checks all grants for a given account.
int
alterQuery(mixed $query, array $tables, string $op, AccountInterface $account, string $base_table)
Alters a query when node access is required.
write(NodeInterface $node, array $grants, string $realm = NULL, bool $delete = TRUE)
Writes a list of grants to the database, deleting previously saved ones.
If a realm is provided, it will only delete grants from that realm, but it will always delete a grant from the 'all' realm. Modules that use node access can use this method when doing mass updates due to widespread permission changes.
Note: Don't call this method directly from a contributed module. Call \Drupal\node\NodeAccessControlHandlerInterface::acquireGrants() instead.
delete()
Deletes all node access entries.
writeDefault()
Creates the default node access grant entry.
int
count()
Counts available node grants.
deleteNodeRecords(array $nids)
Remove the access records belonging to certain nodes.
static protected Condition
buildGrantsQueryCondition(array $node_access_grants)
Creates a query condition from an array of node access grants.