@@ -211,6 +211,18 @@ def __init__(self, message, cause, http_response):
211211 exceptions .AlreadyExistsError .__init__ (self , message , cause , http_response )
212212
213213
214+ class InsufficientPermissionError (exceptions .PermissionDeniedError ):
215+ """The credential used to initialize the SDK lacks required permissions."""
216+
217+ default_message = ('The credential used to initialize the SDK has insufficient '
218+ 'permissions to perform the requested operation. See '
219+ 'https://firebase.google.com/docs/admin/setup for details '
220+ 'on how to initialize the Admin SDK with appropriate permissions' )
221+
222+ def __init__ (self , message , cause , http_response ):
223+ exceptions .PermissionDeniedError .__init__ (self , message , cause , http_response )
224+
225+
214226class InvalidDynamicLinkDomainError (exceptions .InvalidArgumentError ):
215227 """Dynamic link domain in ActionCodeSettings is not authorized."""
216228
@@ -258,6 +270,7 @@ def __init__(self, message, cause=None, http_response=None):
258270 'DUPLICATE_EMAIL' : EmailAlreadyExistsError ,
259271 'DUPLICATE_LOCAL_ID' : UidAlreadyExistsError ,
260272 'EMAIL_EXISTS' : EmailAlreadyExistsError ,
273+ 'INSUFFICIENT_PERMISSION' : InsufficientPermissionError ,
261274 'INVALID_DYNAMIC_LINK_DOMAIN' : InvalidDynamicLinkDomainError ,
262275 'INVALID_ID_TOKEN' : InvalidIdTokenError ,
263276 'PHONE_NUMBER_EXISTS' : PhoneNumberAlreadyExistsError ,
0 commit comments