/// <summary> /// デフォルトACLの設定を行います。 /// </summary> /// <param name="acl">ACL</param> /// <param name="withAccessForCurrentUser">true:オブジェクト作成者に対するフルアクセスをデフォルトで許可する</param> public static void SetDefaultACL(NCMBACL acl, bool withAccessForCurrentUser) { defaultACLWithCurrentUser = null; if (acl != null) { defaultACL = acl._copy(); defaultACL._setShared(true); defaultACLUsesCurrentUser = withAccessForCurrentUser; } else { defaultACL = null; } }
//オブジェクト生成時にデフォルトACLを付与 internal static NCMBACL _getDefaultACL() { //ログイン中ユーザの権限付与をする場合 if ((defaultACLUsesCurrentUser) && (defaultACL != null)) { //ログイン中ユーザが存在しないか、ストア登録されていない場合 if (NCMBUser.CurrentUser == null || NCMBUser.CurrentUser.ObjectId == null) { return(defaultACL); } //ログイン中ユーザが存在し、ストア登録されている場合 defaultACLWithCurrentUser = defaultACL._copy(); defaultACLWithCurrentUser._setShared(true); defaultACLWithCurrentUser.SetReadAccess(NCMBUser.CurrentUser.ObjectId, true); defaultACLWithCurrentUser.SetWriteAccess(NCMBUser.CurrentUser.ObjectId, true); return(defaultACLWithCurrentUser); } return(defaultACL); }
//オブジェクト生成時にデフォルトACLを付与 internal static NCMBACL _getDefaultACL() { //ログイン中ユーザの権限付与をする場合 if ((defaultACLUsesCurrentUser) && (defaultACL != null)) { //ログイン中ユーザが存在しないか、ストア登録されていない場合 if (NCMBUser.CurrentUser == null || NCMBUser.CurrentUser.ObjectId == null) { return defaultACL; } //ログイン中ユーザが存在し、ストア登録されている場合 defaultACLWithCurrentUser = defaultACL._copy (); defaultACLWithCurrentUser._setShared (true); defaultACLWithCurrentUser.SetReadAccess (NCMBUser.CurrentUser.ObjectId, true); defaultACLWithCurrentUser.SetWriteAccess (NCMBUser.CurrentUser.ObjectId, true); return defaultACLWithCurrentUser; } return defaultACL; }
/// <summary> /// デフォルトACLの設定を行います。 /// </summary> /// <param name="acl">ACL</param> /// <param name="withAccessForCurrentUser">true:オブジェクト作成者に対するフルアクセスをデフォルトで許可する</param> public static void SetDefaultACL(NCMBACL acl, bool withAccessForCurrentUser) { defaultACLWithCurrentUser = null; if (acl != null) { defaultACL = acl._copy (); defaultACL._setShared (true); defaultACLUsesCurrentUser = withAccessForCurrentUser; } else { defaultACL = null; } }