예제 #1
0
        /// <summary>
        ///   Delete a <see cref="RoleFunction"/> object passed as an argument.
        /// </summary>
        /// <param name="aUserKey">A <see cref="UserKey"/> object.</param>
        /// <param name="aRoleFunction">A <see cref="RoleFunction"/> object.</param>
        /// <exception cref="ArgumentNullException">If <c>aRoleFunction</c> argument is <c>null</c>.</exception>
        public static void Delete(UserKey aUserKey, RoleFunction aRoleFunction)
        {
            if (aRoleFunction == null)
            {
                throw new ArgumentNullException("Delete RoleFunction Business");
            }

            if (!UserFunctionAccessData.HasModeAccess(aUserKey, "RoleFunction", AccessMode.Delete))
            {
                throw new ZpAccessException("Access Denied", String.Format("{0}", aUserKey.UsrKey), AccessMode.Delete, "RoleFunction");
            }

            RoleFunctionData.Delete(aRoleFunction);
        }
예제 #2
0
        /// <summary>
        ///   The overloaded Load method that will return a <see cref="RoleFunctionCollection"/>.
        /// </summary>
        /// <param name="aUserKey">A <see cref="UserKey"/> object.</param>
        /// <param name="aRoleFunctionCollection">A <see cref="RoleFunctionCollection"/> object.</param>
        /// <exception cref="ArgumentNullException">If <c>aRoleFunctionCollection</c> argument is <c>null</c>.</exception>
        public static void Load(UserKey aUserKey, RoleFunctionCollection aRoleFunctionCollection)
        {
            if (aRoleFunctionCollection == null)
            {
                throw new ArgumentNullException("Load RoleFunction Business");
            }

            if (!UserFunctionAccessData.HasModeAccess(aUserKey, "RoleFunction", AccessMode.List))
            {
                throw new ZpAccessException("Access Denied", String.Format("{0}", aUserKey.UsrKey), AccessMode.List, "RoleFunction");
            }

            RoleFunctionData.Load(aRoleFunctionCollection);
        }