예제 #1
0
        /// <summary>
        /// Creates a new IPersistenceObject by System.Type. Note - this Method is depricated!
        /// </summary>
        /// <param name="ifType">System.Type of the new IPersistenceObject</param>
        /// <returns>A new IPersistenceObject</returns>
        public virtual IDataObject Create(InterfaceType ifType)
        {
            CheckDisposed();
            if (ifType.Type == typeof(Zetbox.App.Base.Blob))
            {
                throw new InvalidOperationException("Creating a Blob is not supported. Use CreateBlob() instead");
            }

            ObjectClass cls = metaDataResolver.GetObjectClass(ifType).GetRootClass();

            if (identityStore != null && cls.HasAccessControlList() && !cls.GetGroupAccessRights(identityStore).HasCreateRights())
            {
                throw new System.Security.SecurityException(string.Format("The current identity has no rights to create an Object of type '{0}'", ifType.Type.FullName));
            }
            return((IDataObject)CreateInternal(ifType));
        }