14543Smarks /* 24543Smarks * CDDL HEADER START 34543Smarks * 44543Smarks * The contents of this file are subject to the terms of the 54543Smarks * Common Development and Distribution License (the "License"). 64543Smarks * You may not use this file except in compliance with the License. 74543Smarks * 84543Smarks * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 94543Smarks * or http://www.opensolaris.org/os/licensing. 104543Smarks * See the License for the specific language governing permissions 114543Smarks * and limitations under the License. 124543Smarks * 134543Smarks * When distributing Covered Code, include this CDDL HEADER in each 144543Smarks * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 154543Smarks * If applicable, add the following below this CDDL HEADER, with the 164543Smarks * fields enclosed by brackets "[]" replaced with your own identifying 174543Smarks * information: Portions Copyright [yyyy] [name of copyright owner] 184543Smarks * 194543Smarks * CDDL HEADER END 204543Smarks */ 214543Smarks /* 2212786SChris.Kirby@oracle.com * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. 234543Smarks */ 244543Smarks 254787Sahrens #ifndef _SYS_DSL_DELEG_H 264787Sahrens #define _SYS_DSL_DELEG_H 274543Smarks 284543Smarks #include <sys/dmu.h> 294543Smarks #include <sys/dsl_pool.h> 304543Smarks #include <sys/zfs_context.h> 314543Smarks 324543Smarks #ifdef __cplusplus 334543Smarks extern "C" { 344543Smarks #endif 354543Smarks 364543Smarks #define ZFS_DELEG_PERM_NONE "" 374543Smarks #define ZFS_DELEG_PERM_CREATE "create" 384543Smarks #define ZFS_DELEG_PERM_DESTROY "destroy" 394543Smarks #define ZFS_DELEG_PERM_SNAPSHOT "snapshot" 404543Smarks #define ZFS_DELEG_PERM_ROLLBACK "rollback" 414543Smarks #define ZFS_DELEG_PERM_CLONE "clone" 424543Smarks #define ZFS_DELEG_PERM_PROMOTE "promote" 434543Smarks #define ZFS_DELEG_PERM_RENAME "rename" 444543Smarks #define ZFS_DELEG_PERM_MOUNT "mount" 454543Smarks #define ZFS_DELEG_PERM_SHARE "share" 464543Smarks #define ZFS_DELEG_PERM_SEND "send" 474543Smarks #define ZFS_DELEG_PERM_RECEIVE "receive" 484543Smarks #define ZFS_DELEG_PERM_ALLOW "allow" 494543Smarks #define ZFS_DELEG_PERM_USERPROP "userprop" 505331Samw #define ZFS_DELEG_PERM_VSCAN "vscan" 519396SMatthew.Ahrens@Sun.COM #define ZFS_DELEG_PERM_USERQUOTA "userquota" 529396SMatthew.Ahrens@Sun.COM #define ZFS_DELEG_PERM_GROUPQUOTA "groupquota" 539396SMatthew.Ahrens@Sun.COM #define ZFS_DELEG_PERM_USERUSED "userused" 549396SMatthew.Ahrens@Sun.COM #define ZFS_DELEG_PERM_GROUPUSED "groupused" 5510242Schris.kirby@sun.com #define ZFS_DELEG_PERM_HOLD "hold" 5610242Schris.kirby@sun.com #define ZFS_DELEG_PERM_RELEASE "release" 57*13043STim.Haley@Sun.COM #define ZFS_DELEG_PERM_DIFF "diff" 584787Sahrens 594787Sahrens /* 604787Sahrens * Note: the names of properties that are marked delegatable are also 614787Sahrens * valid delegated permissions 624787Sahrens */ 634543Smarks 644543Smarks int dsl_deleg_get(const char *ddname, nvlist_t **nvp); 654543Smarks int dsl_deleg_set(const char *ddname, nvlist_t *nvp, boolean_t unset); 664543Smarks int dsl_deleg_access(const char *ddname, const char *perm, cred_t *cr); 6712786SChris.Kirby@oracle.com int dsl_deleg_access_impl(struct dsl_dataset *ds, const char *perm, cred_t *cr); 684543Smarks void dsl_deleg_set_create_perms(dsl_dir_t *dd, dmu_tx_t *tx, cred_t *cr); 694543Smarks int dsl_deleg_can_allow(char *ddname, nvlist_t *nvp, cred_t *cr); 704543Smarks int dsl_deleg_can_unallow(char *ddname, nvlist_t *nvp, cred_t *cr); 714543Smarks int dsl_deleg_destroy(objset_t *os, uint64_t zapobj, dmu_tx_t *tx); 724787Sahrens boolean_t dsl_delegation_on(objset_t *os); 734543Smarks 744543Smarks #ifdef __cplusplus 754543Smarks } 764543Smarks #endif 774543Smarks 784787Sahrens #endif /* _SYS_DSL_DELEG_H */ 79