           return callback new KodingError \
                  'Identifier already in use, please change it first'
 
-        # Check if the app has a slug, if not create one
-        unless @getAt 'slug'
-          this.createSlug (err, slug)=>
-            return callback err  if err
-            slug = slug_ = slug.slug
-            @update {slug, slug_, approved:yes}, callback
-        else
-          @update approved:yes, callback
+
+  # approve: permit 'approve apps',
+
+  #   success: (client, state = yes, callback)->
+
+  #     # Disapprove
+  #     unless state
+
+  #       return @update $set:{approved: no}, callback
+
+  #     identifier = @getAt 'identifier'
+
+  #     JApp.count {identifier, approved:yes}, (count)=>
+
+  #       # Check if any app used same identifier and already approved
+  #       if count > 1
+  #         return callback new KodingError \
+  #                'Identifier already in use, please change it first'
+
+  #       # Check if the app has a slug, if not create one
+  #       unless @getAt 'slug'
+  #         this.createSlug (err, slug)=>
+  #           return callback err  if err
+  #           slug = slug_ = slug.slug
+  #           @update {slug, slug_, approved:yes}, callback
+  #       else
+  #         @update approved:yes, callback
 
   # JApp.one
     #   name : data.name


    sharedMethods       :
      instance          : [
        'approve', 'fetchRelativeReviews'
        # 'approve', 'review', 'delete', 'install'
        # 'follow', 'unfollow', 'delete', 'review',
        # 'like', 'checkIfLikedBefore', 'fetchLikedByes',
        # 'fetchFollowersWithRelationship', 'install',
        # 'fetchFollowingWithRelationship', 'fetchCreator',
        # 'fetchRelativeReviews', 'approve'
      ]
      static            : [
        'create', 'someWithRelationship', 'one'
        # , 'someWithRelationship', 'updateAllSlugs'
        # 'some', 'each', 'fetchAllAppsData'
      ]

    permissions         :

  #         @update ($set: approved: state), (err)=>
  #           callback err

  # @markInstalled = secure (client, apps, callback)->
  #   Relationship.all
  #     targetId  : client.connection.delegate.getId()
  #     as        : 'user'
  #     sourceType: 'JApp'
  #   , (err, relationships)->
  #     apps.forEach (app)->
  #       app.installed = no
  #       for relationship, index in relationships
  #         if app._id is relationship.sourceId
  #           app.installed = yes
  #           relationships.splice index,1
  #           break
  #     callback err, apps

  # delete: secure ({connection:{delegate}}, callback)->

  #   if delegate.can 'delete', this
  #     @remove callback


  # # modify: permit
